Skip to content

Commit 906dd1a

Browse files
committed
reorganize layout with includes
1 parent fc1d303 commit 906dd1a

File tree

5 files changed

+103
-98
lines changed

5 files changed

+103
-98
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ This collects all your publications to a central place. It lists all the publica
8080

8181
This is where you should spend most of your time. Every publication is a subdirectory of `_publications` containing at least an `index.md` file. However, if you want to also have a proper publication page, you should also add a `content.hmtl` file and an assets folder. The layout of the header for the publications is defined in `_layouts/publications.html`.
8282

83-
`index.md` contains all the meta information about publications that is used in `_layouts/publications.html` to generate the header and provide the information for the publication overview. We show an example file to introduce the different options
83+
`index.md` contains all the meta information about publications that is used in `_layouts/publications.html` to generate the project page. `_layouts/publications.html` itself uses smaller snippets from `_include` to generate a header, citation, and acknowledgements. We show an example file to introduce the different options
8484

8585
```
8686
layout: publications # defines the layout used for this publication. Leave it as publications or create your own layout under _layouts

_includes/acknowledgements.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% if page.acknowledgements != nil %}
2+
<footer class="footer">
3+
<div class="container">
4+
<div class="columns is-centered">
5+
<div class="column is-8">
6+
<div class="content">
7+
<h2>Acknowledgements</h2>
8+
<p>
9+
{{page.acknowledgements}}
10+
</p>
11+
</div>
12+
</div>
13+
</div>
14+
</div>
15+
</footer>
16+
{% endif %}

_includes/citation.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% if page.citation != nil %}
2+
<section class="hero teaser">
3+
<div class="container is-max-desktop">
4+
<div class="hero-body">
5+
<!-- citation -->
6+
<h2>Citation <a onclick="CopyToClipboard('{{page.citation}}')" class="btn btn--primary">
7+
<i class="fa fa-copy"></i>
8+
</a></h2>
9+
<pre>
10+
<code id="citation_block">
11+
</code>
12+
</pre>
13+
<script src="{{ site.baseurl }}{% link js/copy_to_clipboard.js %}"></script>
14+
<script>
15+
document.getElementById("citation_block").innerHTML = formateCitationHTML("{{page.citation}}");
16+
</script>
17+
</div>
18+
</div>
19+
</section>
20+
{% endif %}

_includes/header.html

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<section class="hero">
2+
<div class="hero-body">
3+
<div class="container is-max-desktop">
4+
<div class="columns is-centered">
5+
<div class="column has-text-centered">
6+
<h1 class="title is-1 publication-title">{{ page.title }}</h1>
7+
<h3 class="title is-3 publication-title">{{ page.venue }}</h3>
8+
<div class="is-size-5 publication-authors">
9+
{% for author_id in page.authors %}
10+
{% if site.data.authors_external[author_id.name] != nil %}
11+
{% assign author = site.data.authors_external[author_id.name] %}
12+
{% endif %}
13+
{% if site.data.authors_internal[author_id.name] != nil %}
14+
{% assign author = site.data.authors_internal[author_id.name] %}
15+
{% endif %}
16+
<span class="author-block">
17+
<a href="{{author.website}}" target="_blank">{{ author.first_name }} {{ author.middle_name }} {{ author.last_name }}</a><sup>{% if author_id.equal_contribution != nil %}*{% endif %}{{ author_id.affiliations }}</sup>
18+
</span>
19+
{% endfor %}
20+
</div>
21+
<div class="is-size-5 publication-affiliations">
22+
{% assign i = 1 %}
23+
{% for aff_id in page.affiliations %}
24+
{% assign affiliation = site.data.affiliations[aff_id.name] %}
25+
<span class="affiliation-block">
26+
<sup>{{i}}</sup>{{affiliation[aff_id.length]}}
27+
</span>
28+
{% assign i = i|plus:1 %}
29+
{% endfor %}
30+
</div>
31+
<div class="column has-text-centered">
32+
<div class="publication-links">
33+
{% for link in page.links %}
34+
{% if link.name != "Project Page" %}
35+
<span class="link-block">
36+
<a href="{{ link.link }}" target="_blank" class="external_link button is-normal is-rounded is-dark">
37+
<span class="icon">
38+
{% if link.style != nil %}
39+
<i class="{{link.style}}"></i>
40+
{% else %}
41+
<i class="fas fa-external-link-alt"></i>
42+
{% endif %}
43+
</span>
44+
<span>{{link.name}}</span>
45+
</a>
46+
</span>
47+
{% endif %}
48+
{% endfor %}
49+
</div>
50+
</div>
51+
</div>
52+
</div>
53+
</div>
54+
</div>
55+
</section>

_layouts/publications.html

Lines changed: 11 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -25,109 +25,23 @@
2525
<script defer src="{{ '/js/fontawesome.all.min.js' | relative_url }}"></script>
2626
<script src="{{ '/js/index.js' | relative_url }}"></script>
2727
{% if page.icon %}
28-
<link rel="icon" type="image/x-icon" href="{{ page.icon }}">
28+
<link rel="icon" type="image/x-icon" href="{{ page.icon }}">
2929
{% else %}
30-
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
30+
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
3131
{% endif %}
3232
</head>
3333

3434
<body>
3535
<center>
36-
<section class="hero">
37-
<div class="hero-body">
38-
<div class="container is-max-desktop">
39-
<div class="columns is-centered">
40-
<div class="column has-text-centered">
41-
<h1 class="title is-1 publication-title">{{ page.title }}</h1>
42-
<h3 class="title is-3 publication-title">{{ page.venue }}</h3>
43-
<div class="is-size-5 publication-authors">
44-
{% for author_id in page.authors %}
45-
{% if site.data.authors_external[author_id.name] != nil %}
46-
{% assign author = site.data.authors_external[author_id.name] %}
47-
{% endif %}
48-
{% if site.data.authors_internal[author_id.name] != nil %}
49-
{% assign author = site.data.authors_internal[author_id.name] %}
50-
{% endif %}
51-
<span class="author-block">
52-
<a href="{{author.website}}" target="_blank">{{ author.first_name }} {{ author.middle_name }} {{ author.last_name }}</a><sup>{% if author_id.equal_contribution != nil %}*{% endif %}{{ author_id.affiliations }}</sup>
53-
</span>
54-
{% endfor %}
55-
</div>
56-
<div class="is-size-5 publication-affiliations">
57-
{% assign i = 1 %}
58-
{% for aff_id in page.affiliations %}
59-
{% assign affiliation = site.data.affiliations[aff_id.name] %}
60-
<span class="affiliation-block">
61-
<sup>{{i}}</sup>{{affiliation[aff_id.length]}}
62-
</span>
63-
{% assign i = i|plus:1 %}
64-
{% endfor %}
65-
</div>
66-
<div class="column has-text-centered">
67-
<div class="publication-links">
68-
{% for link in page.links %}
69-
{% if link.name != "Project Page" %}
70-
<span class="link-block">
71-
<a href="{{ link.link }}" target="_blank" class="external_link button is-normal is-rounded is-dark">
72-
<span class="icon">
73-
{% if link.style != nil %}
74-
<i class="{{link.style}}"></i>
75-
{% else %}
76-
<i class="fas fa-external-link-alt"></i>
77-
{% endif %}
78-
</span>
79-
<span>{{link.name}}</span>
80-
</a>
81-
</span>
82-
{% endif %}
83-
{% endfor %}
84-
</div>
85-
</div>
86-
</div>
87-
</div>
88-
</div>
89-
</div>
90-
</section>
91-
</center>
92-
<!-- Content -->
93-
{{ page.content }}
94-
<section class="hero teaser">
95-
<div class="container is-max-desktop">
96-
<div class="hero-body">
97-
<!-- citation -->
98-
{% if page.citation != nil %}
99-
<h2>Citation <a onclick="CopyToClipboard('{{page.citation}}')" class="btn btn--primary">
100-
<i class="fa fa-copy"></i>
101-
</a></h2>
102-
<pre>
103-
<code id="citation_block">
104-
</code>
105-
</pre>
106-
<script src="{{ site.baseurl }}{% link js/copy_to_clipboard.js %}"></script>
107-
<script>
108-
document.getElementById("citation_block").innerHTML = formateCitationHTML("{{page.citation}}");
109-
</script>
110-
{% endif %}
111-
</div>
112-
</div>
113-
</section>
114-
<!-- Acknowledgements -->
115-
{% if page.acknowledgements != nil %}
116-
<footer class="footer">
117-
<div class="container">
118-
<div class="columns is-centered">
119-
<div class="column is-8">
120-
<div class="content">
121-
<h2>Acknowledgements</h2>
122-
<p>
123-
{{page.acknowledgements}}
124-
</p>
125-
</div>
126-
</div>
127-
</div>
128-
</div>
129-
</footer>
130-
{% endif %}
36+
{% include header.html %}
37+
</center>
38+
<!-- Content -->
39+
{{ page.content }}
40+
41+
{% include citation.html %}
42+
<!-- Acknowledgements -->
43+
44+
{% include acknowledgements.html %}
13145
</body>
13246

13347
</html>

0 commit comments

Comments
 (0)