Commit 6a488059 authored by Ken Hawkins's avatar Ken Hawkins
Browse files

Handle excotic characters in job title

& it up
parent b1c02df2
Pipeline #116757 passed with stages
in 13 minutes and 24 seconds
......@@ -115,7 +115,7 @@ module.exports = function(config) {
// receive format of `2015-10-08T15:30:00` and make it pretty with Moment.js
config.addFilter("dateMoment", (time, format = "D MMMM YYYY, HH:mm") => {
console.log('time',time)
// console.log('time',time)
time = time.toString().replace('T',' '); // no need for T in timestamp
time = time || new Date();
if (format == 'unix') {
......@@ -125,7 +125,12 @@ module.exports = function(config) {
}
});
// do some common cleanup on job title
config.addFilter("jobTitleClean", (input) => {
input = input.replace('&','&');
return input;
});
// Shortcodes
// https://www.11ty.io/docs/shortcodes/
// -----
......
......@@ -18,7 +18,7 @@
{%- endif %}
<!-- Descriptive meta -->
<meta name="title" content="{{ pagination.items[0].title }} | {{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}">
<meta name="title" content="{{ pagination.items[0].title | safe | jobTitleClean | safe }} | {{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}">
<meta name="author" content="{{ meta.author or "EMBL" }}">
<meta name="robots" content="index, follow">
<meta name="keywords" content="{{pagination.items[0].field_jobs_group}}, {{pagination.items[0].field_jobs_categorisation}}, {{ meta.keywords }}">
......@@ -28,7 +28,7 @@
<meta property="og:type" content="website">
<meta property="og:url" content="https://embl.org/jobs{{ page.url }}">
<meta property="og:title" content="{{ pagination.items[0].title }} | {{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}">
<meta property="og:title" content="{{ pagination.items[0].title | safe | jobTitleClean | safe }} | {{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}">
<meta property="og:description" content="{{ pagination.items[0].field_jobs_description | striptags | truncate(150) }}">
{% if meta.image -%}
<meta property="og:image" content="{{ meta.image }}">
......@@ -37,7 +37,7 @@
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="og:url" content="https://embl.org/jobs{{ page.url }}">
<meta property="twitter:title" content="{{ pagination.items[0].title }} | {{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}">
<meta property="twitter:title" content="{{ pagination.items[0].title | safe | jobTitleClean | safe }} | {{ title or (renderData and renderData.title) or siteConfig.siteInformation.title}}">
<meta property="twitter:description" content="{{ pagination.items[0].field_jobs_description | striptags | truncate(150) }}">
{% if meta.image -%}
<meta property="twitter:image" content="{{ meta.image }}">
......@@ -64,7 +64,7 @@
<!-- analytics -->
{# <meta name="vf:page-type" content="{{ meta.pagetype }}"> for analytics tracking #}
<title>{{ pagination.items[0].title }} | Jobs | EMBL</title>
<title>{{ pagination.items[0].title | safe | jobTitleClean | safe }} | Jobs | EMBL</title>
{% render '@vf-no-js' %}
{% render '@embl-favicon' %}
</head>
......
......@@ -164,8 +164,8 @@ embl_content_meta_properties:
</p>
<h3 class="vf-summary__title">
<a href="/jobs/position/{{ job.field_jobs_reference_number }}" class="vf-summary__link">
{{ job.title | striptags }}
<a href="/jobs/position/{{ job.field_jobs_reference_number }}" class="vf-summary__link">dddd
{{ job.title | striptags | safe | jobTitleClean | safe }}
</a>
</h3>
......@@ -207,7 +207,7 @@ embl_content_meta_properties:
<h3 class="vf-summary__title">
<a href="/jobs/position/{{ job.field_jobs_reference_number }}" class="vf-summary__link">
{{ job.title | striptags }}
{{ job.title | striptags | safe }}
</a>
</h3>
......
......@@ -55,7 +55,7 @@ embl_content_meta_properties:
</div>
<div class="vf-content">
# {{pagination.items[0].title}}
# {{pagination.items[0].title | safe }}
<br/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment