8000 feat(home): write about me in markdown, reST or asciidoc · Pelican-Elegant/elegant@9b5b2ec · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 9b5b2ec

Browse files
committed
feat(home): write about me in markdown, reST or asciidoc
BREAKING CHANGE: Previously LANDING_PAGE_ABOUT was a dictionary that contained html tags. We used it to create landing page. But users have demanded from the very beginning to be able to write the landing page in markdown. This patch adds this feature. But in order to use it, you have to update your configuration. fix #85
1 parent 23e0b94 commit 9b5b2ec

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

templates/_includes/_defaults.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,12 @@
119119
{% set USE_SHORTCUT_ICONS = USE_SHORTCUT_ICONS %}
120120
{% endif %}
121121

122-
{# It is a dictionary with two keys: title, details. Value of each key is a
123-
string. It is used to display About me section on the home page.
124-
LANDING_PAGE_ABOUT = {'title': 'Talha Mansoor',
125-
'details': '<p>I am a software developer. This blog is'
126-
'my personal space in the cyber world!</p>'
127-
}
122+
{# It is a string
128123
#}
129-
{% if not LANDING_PAGE_ABOUT %}
130-
{% set LANDING_PAGE_ABOUT = '' %}
124+
{% if not LANDING_PAGE_TITLE %}
125+
{% set LANDING_PAGE_TITLE = '' %}
131126
{% else %}
132-
{% set LANDING_PAGE_ABOUT = LANDING_PAGE_ABOUT %}
127+
{% set LANDING_PAGE_TITLE = LANDING_PAGE_TITLE %}
133128
{% endif %}
134129

135130
{# It is an array of dictionaries. Each dictionary has three keys: name, url,

templates/index.html

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
{% block meta_tags_in_head %}
88
{{ super() }}
9-
{% from '_includes/_defaults.html' import LANDING_PAGE_ABOUT with context %}
10-
{% if LANDING_PAGE_ABOUT and LANDING_PAGE_ABOUT.title %}
11-
<meta property="og:title" content="{{ LANDING_PAGE_ABOUT.title|e }}"/>
12-
<meta name="twitter:title" content="{{ LANDING_PAGE_ABOUT.title|e }}">
9+
{% from '_includes/_defaults.html' import LANDING_PAGE_TITLE with context %}
10+
{% if LANDING_PAGE_TITLE %}
11+
<meta property="og:title" content="{{ LANDING_PAGE_TITLE|e }}"/>
12+
<meta name="twitter:title" content="{{ LANDING_PAGE_TITLE|e }}">
1313
{% else %}
1414
<meta property="og:title" content="{{ SITENAME|striptags|e }}"/>
1515
<meta name="twitter:title" content="{{ SITENAME|striptags|e }}">
@@ -30,39 +30,47 @@
3030
{% endblock meta_tags_in_head %}
3131

3232
{% block content %}
33-
{% from '_includes/_defaults.html' import LANDING_PAGE_ABOUT with context %}
33+
{% from '_includes/_defaults.html' import LANDING_PAGE_TITLE with context %}
3434
{% from '_includes/_defaults.html' import PROJECTS with context %}
3535
{% from '_includes/_defaults.html' import PROJECTS_TITLE with context %}
36+
37+
{% set landing_page = namespace(page=false) %}
38+
{% for p in hidden_pages if p.slug == "landing-page-about-hidden" %}
39+
{% set landing_page.page = p %}
40+
{% endfor %}
41+
42+
{{landing_page.page.title}}
43+
3644
<div class="row-fluid">
37-
{% if LANDING_PAGE_ABOUT and LANDING_PAGE_ABOUT.title %}
45+
{% if LANDING_PAGE_TITLE %}
3846
{% set css_class = 'span10 offset2' %}
39-
{% if PROJECTS and LANDING_PAGE_ABOUT %}
47+
{% if PROJECTS and LANDING_PAGE_TITLE %}
4048
{% set css_class = 'span12' %}
4149
{% endif %}
4250
<header class="page-header {{css_class}}">
43-
<h1><a href="{{ SITEURL }}">{{ LANDING_PAGE_ABOUT.title }}</a></h1>
51+
<h1><a href="{{ SITEURL }}">{{ LANDING_PAGE_TITLE }}</a></h1>
4452
</header>
4553
{% endif %}
4654

4755
<div class="row-fluid">
48-
{% if LANDING_PAGE_ABOUT and LANDING_PAGE_ABOUT.details %}
56+
{% if LANDING_PAGE_TITLE and landing_page.page %}
4957
{% set css_class = 'span8 offset2' %}
50-
{% if PROJECTS and LANDING_PAGE_ABOUT %}
58+
{% if PROJECTS and LANDING_PAGE_TITLE %}
5159
{% set css_class = 'span8' %}
5260
{% endif %}
5361
<div class="{{css_class}}">
5462
<header>
55-
<h1 id="about-me">About me</h1>
63+
<h1 id="about-me">{{landing_page.page.title}}</h1>
5664
</header>
5765
<div class="article-content">
58-
{{ LANDING_PAGE_ABOUT.details }}
66+
{{ landing_page.page.content }}
5967
</div>
6068
</div>
6169
{% endif %}
6270

6371
{% if PROJECTS %}
6472
{% set css_class = 'span8 offset2' %}
65-
{% if PROJECTS and LANDING_PAGE_ABOUT %}
73+
{% if PROJECTS and LANDING_PAGE_TITLE %}
6674
{% set css_class = 'span4' %}
6775
{% endif %}
6876
<div class="{{css_class}}">
@@ -82,7 +90,7 @@ <h1 id="my-projects">{{ PROJECTS_TITLE }}</h1>
8290

8391
{% if articles %}
8492
{% set css_class = 'span8 offset2' %}
85-
{% if articles and PROJECTS and LANDING_PAGE_ABOUT %}
93+
{% if articles and PROJECTS and LANDING_PAGE_TITLE %}
8694
{% set css_class = 'span12' %}
8795
{% endif %}
8896
<div class="row-fluid">

0 commit comments

Comments
 (0)
0