Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc57be5

Browse files
authored
Merge pull request#1 from pymc-labs/oriol_picture
Several changes: Oriol, metadata and personal link
2 parents9e5374a +e59acbd commitbc57be5

File tree

8 files changed

+81
-3
lines changed

8 files changed

+81
-3
lines changed

‎README.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,36 @@ Uses Jinja2 templating.
4444
They are pulled from GitHub by just loading
4545
whatever URL to our main profile page is.
4646

47+
###Metadata
48+
Most forums and social networks nowadays can use fancy card views with a
49+
title, a description and an image, which serves as a link preview. For the
50+
card preview to work, the`<head>` section must include some metadata fields.
51+
52+
The most important fields have been configured for all pages with some
53+
defaults and they can be overwritten from more specific templates. See
54+
`templates/layout.html` for info on how to set the metadata and the defaults
55+
used.
56+
57+
`og_title`,`og_description` and`og_image` block can be used to modify the default title
58+
description and image in the card respectively. Here is one example from the
59+
teammates template:
60+
61+
```html
62+
<!-- layout sets the metadata defaults and blocks to modify it-->
63+
{% extends "layout.html" %}
64+
<!-- Use og_title to modify the default "PyMC Labs" as title-->
65+
<!-- Note that this only affects the card title, not the title shown by the browser-->
66+
{% block og_title %}{{ this.name }} - PyMC Labs{% endblock %}
67+
<!-- Use og_title to modify the default "Bespoke Bayesian Modeling" as description-->
68+
{% block og_description %}{{ this.blurb|string }}{% endblock %}
69+
```
70+
71+
See more on possible metadata fields[here](https://ogp.me/). Moreover,
72+
Twitter is extremely picky and in addition to being the most restrictive in
73+
general, also requires an extra line to choose between the`summary` or
74+
`summary_large_image` card types. For now all pages use`summary` format, but
75+
this could be modified or left to configure for each page if desired.
76+
4777
###Other stuff to edit?
4878

4979
Consult:
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
name: Oriol Abril Pla
22
---
3-
picture:https://avatars3.githubusercontent.com/u/23738400?s=400&u=e12583539a9f95064bc8559c0669a2f00906bb41&v=4
3+
picture:https://github.com/OriolAbril/calaix_de_sastre/raw/master/oriol-abril-pla.png
44
---
55
github_url:https://github.com/OriolAbril
6+
---
7+
location: Barcelona, Spain
8+
---
9+
blurb: Trying to develop and apply new methodology for a robust and reproducible statistical analysis workflow.
10+
---
11+
twitter_url:https://twitter.com/OriolAbril
12+
---
13+
linkedin_url:https://www.linkedin.com/in/oriol-abril-pla-1b9123180/
14+
---
15+
personal_url:https://oriolabril.github.io/oriol_unraveled/
16+
---
17+
specializations: Bayesian statistics, Model comparison

‎models/index.ini‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ type = string
1414
label = Mission
1515
type = markdown
1616

17+
[fields.description]
18+
label = The company in one sentence
19+
type = markdown
20+
1721
; [fields.flow]
1822
; type = flow

‎models/teammate.ini‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ type = url
2121
label = Linkedin URL
2222
type = url
2323

24+
[fields.personal_url]
25+
label = Personal URL
26+
type = url
27+
2428
[fields.specializations]
2529
label = Specializations (comma-separated)
2630
type = string
@@ -31,4 +35,4 @@ type = string
3135

3236
[fields.blurb]
3337
label = Blurb (140 characters)
34-
type =markdown
38+
type =string

‎templates/layout.html‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"crossorigin="anonymous">
1919

2020
<title>PyMC Labs</title>
21+
<metaname="twitter:card"content="summary">
22+
<metaproperty="og:url"content="{{ this|url(external=true) }}"/>
23+
<metaproperty="og:type"content="website"/>
24+
<metaproperty="og:title"content="{% block og_title%}PyMC Labs{% endblock %}"/>
25+
<metaproperty="og:description"content="{% block og_description%}Bespoke Bayesian Modeling{% endblock %}"/>
26+
<metaproperty="og:image"content="{% block og_image%}https://raw.githubusercontent.com/pymc-devs/pymcon/gh-pages/assets/contact.png{% endblock %}"/>
27+
2128
</head>
2229

2330
<body>

‎templates/macros/teammate.html‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ <h4 class="card-title text-center">{{ teammate.name }}</h4>
2525
<iclass="fab fa-linkedin"></i>
2626
</a>
2727
{% endif %}
28+
29+
{% if teammate.personal_url %}
30+
<ahref="{{ teammate.personal_url }}">
31+
<iclass="fas fa-globe"></i>
32+
</a>
33+
{% endif %}
2834
</div>
2935
</div>
3036
</div>
@@ -40,6 +46,10 @@ <h4 class="card-title text-center">{{ teammate.name }}</h4>
4046
<divclass="card-body">
4147
<h4class="card-title text-center">{{ teammate.name }}</h4>
4248

49+
{%if teammate.blurb %}
50+
<p>{{ teammate.blurb }}</p>
51+
{% endif %}
52+
4353
{%if teammate.specializations %}
4454
<h5>Specializations</h5>
4555
<p>{{ teammate.specializations }}</p>
@@ -68,6 +78,12 @@ <h5>Location</h5>
6878
<iclass="fab fa-linkedin"></i>
6979
</a>
7080
{% endif %}
81+
82+
{% if teammate.personal_url %}
83+
<ahref="{{ teammate.personal_url }}">
84+
<iclass="fas fa-globe"></i>
85+
</a>
86+
{% endif %}
7187
</div>
7288
</div>
7389
</div>

‎templates/team.html‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{% extends "layout.html" %}
22
{% from "macros/teammate.html" import render_teammate_card %}
3+
{% block og_title %}Our Team - PyMC Labs{% endblock %}
4+
{% block og_description %}Meet the team of statistical consultants at PyMC Labs.{% endblock %}
35
{% block body %}
46
<style>
57
.img-round {
@@ -13,7 +15,7 @@
1315
</style>
1416
<divclass="row">
1517
{% for teammate in this.children %}
16-
{{ render_teammate_card(teammate)}}
18+
{{ render_teammate_card(teammate)}}
1719
{% endfor %}
1820
</div>
1921
{% endblock %}

‎templates/teammate.html‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{% extends "layout.html" %}
22
{% from "macros/teammate.html" import render_teammate_page %}
3+
{% block og_title %}{{ this.name }} - PyMC Labs{% endblock %}
4+
{% block og_description %}{{ this.blurb|string }}{% endblock %}
5+
{% block og_image %}{{ this.picture }}{% endblock %}
36
{% block body %}
47
{{ render_teammate_page(this)}}
58

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp