Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Made first paragraph a sub title
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasmh committed May 23, 2017
1 parent e2f3ce6 commit f5ea89c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion posts/2016-02-25-The-Competition.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ date: 2016-02-25 10:00:00
categories: IARC competition
author: Marius Maaland
---
Ascend NTNU was founded with the primary mission of participating in (and winning) the [International Aerial Robotics Competition (IARC)](http://aerialroboticscompetition.org/) in 2016 and onwards.
Ascend NTNU was founded with the primary mission of participating in (and winning) the [International Aerial Robotics Competition (IARC)](http://aerialroboticscompetition.org/) in 2016 and onwards.

The IARC is the longest running collegiate aerial robotics challenge in the world, whose primary goal is to “move the state-of-the-art in aerial robotics forward”. In order to succeed with this ambitious mission, the IARC poses challenges deemed “impossible” when introduced. When a team, or a number of teams, complete the challenges in a sufficient manner, the world of aerial robotics will have advanced. This goal of advancing technology is what sparked our interest in entering this competition (aside from, you know, [drones](https://www.youtube.com/watch?v=CCDIuZUfETc)!).

Expand Down
8 changes: 6 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,8 @@ function createFBInstantArticle (data) {
data.attributes.image = 'https://ascendntnu.no' + (data.attributes.image || '/images/logo/logo.png')
data.link = data.link || ''
var date = data.attributes.date.toISOString()
var parsed = reader.parse(data.body)
var ingress = rmMdLinks(data.body.split(/\n/)[0])
var parsed = reader.parse(data.body.split(/^[^\n]+\n/)[1])
var result = writer.render(parsed)
.replace(/<p><img ([^>]*)\><\/p>/g, '<figure><img $1></figure>')
.replace(/<(\/?)h[3-6]>/g, '<$1h2>')
Expand All @@ -606,12 +607,14 @@ function createFBInstantArticle (data) {
reTex = /<tex([^>]*)>([^<]*)<\/tex>/g
var texSplit = result.split(/<tex|<\/tex>/g)
var newResult = ''

for (var i = 0; i < texSplit.length - 1; i += 2) {
var parts = texSplit[i + 1].split('>')
var meta = parts[0]
var tex = parts[1]
newResult += texSplit[i] + `<span${meta}>${texToAscii(tex)}</span>`
}

result = newResult + texSplit[texSplit.length - 1]

return `<!doctype html>
Expand All @@ -627,7 +630,7 @@ function createFBInstantArticle (data) {
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"about": "${rmMdLinks(data.body.split(/\n/)[0])}",
"about": "${ingress}",
"author": {
"@type": "Person",
"name": "${data.attributes.author.split(/\s*[,&]\s*/).join(', ') || 'Ascend NTNU'}"
Expand All @@ -647,6 +650,7 @@ function createFBInstantArticle (data) {
<article>
<header>
<h1>${data.attributes.title}</h1>
<h2>${ingress}</h2>
<time class="op-published" datetime="${data.attributes.date}">${date}</time>
<address>
<a>${data.attributes.author.split(/\s*&\s*/).join(' &#038; ')}</a>
Expand Down

0 comments on commit f5ea89c

Please sign in to comment.