improve formatting script and handle formatting errors
This commit is contained in:
@@ -44,6 +44,9 @@ do
|
||||
sed -i "" "s|private: 1| private: 1\\
|
||||
socialLinks: {\\
|
||||
}|g" "$file"
|
||||
sed -i "" "s|private: 0| private: 0\\
|
||||
socialLinks: {\\
|
||||
}|g" "$file"
|
||||
|
||||
move_below category: excerpt: $file
|
||||
move_below memberships: excerpt: $file
|
||||
@@ -65,6 +68,10 @@ do
|
||||
sed -i "" "s|$WEBSITES|$WEBSITES,|g" "$file"
|
||||
LINKEDIN="$(grep -n 'linkedin:' "$file" | sed -n -e 's/^.*\(\(linkedin:\).*\)/\1/p')"
|
||||
sed -i "" "s|$LINKEDIN|$LINKEDIN,|g" "$file"
|
||||
if exists "github" $file; then
|
||||
GITHUB="$(grep -n 'github:' "$file" | sed -n -e 's/^.*\(\(github:\).*\)/\1/p')"
|
||||
sed -i "" "s|$GITHUB|$GITHUB,|g" "$file"
|
||||
fi
|
||||
|
||||
# put id into square brackets for people taxonomy
|
||||
ID="$(grep -n 'id:' "$file" | sed -n -e 's/^.*\(\(id:\).*\)/\1/p')"
|
||||
@@ -82,27 +89,30 @@ do
|
||||
replace "projects:" "organizations:" $file
|
||||
replace "image: ./" "imgPath: " $file
|
||||
|
||||
sed -i "" "s|image:|extra:\\
|
||||
image:|g" "$file"
|
||||
sed -i "" "s|imgPath:|extra:\\
|
||||
imgPath:|g" "$file"
|
||||
sed -i "" "s|id:|taxonomies:\\
|
||||
people:|g" "$file"
|
||||
|
||||
add_tab "memberships:" $file
|
||||
add_tab "categories:" $file
|
||||
add_tab "cities:" $file
|
||||
add_tab "countries:" $file
|
||||
add_tab "extra:" $file
|
||||
add_tab "organizations:" $file
|
||||
add_tab "LinkedIn:" $file
|
||||
add_tab "LinkedIn:" $file
|
||||
add_tab "websites:" $file
|
||||
add_tab "websites:" $file
|
||||
add_tab "github:" $file
|
||||
add_tab "github:" $file
|
||||
|
||||
#dir_path=${file%/*}
|
||||
#fname=${dir_path##*/}
|
||||
#mkdir content/people/$fname
|
||||
#mv -s $file content/people/$fname/index.md
|
||||
dir_path=${file%/*}
|
||||
fname=${dir_path##*/}
|
||||
mkdir content/people/$fname
|
||||
ln -s ../../../$file content/people/$fname/index.md
|
||||
ln -s ../../../$dir_path/$fname.jpg content/people/$fname
|
||||
#ln -s ${file%/*} content/people
|
||||
|
||||
|
||||
mv $file ${file%/*}/index.md
|
||||
mv ${file%/*} content/people
|
||||
|
||||
break
|
||||
|
||||
done;
|
||||
|
||||
echo "Formatting blogs..."
|
||||
@@ -127,10 +137,15 @@ do
|
||||
sed -i "" "s|image: ./|extra:\\
|
||||
imgPath: |g" "$file"
|
||||
|
||||
mv $file ${file%/*}/index.md
|
||||
mv ${file%/*} content/blog
|
||||
add_tab "tags" $file
|
||||
add_tab "categories" $file
|
||||
|
||||
dir_path=${file%/*}
|
||||
fname=${dir_path##*/}
|
||||
mkdir content/blog/$fname
|
||||
ln -s ../../../$file content/blog/$fname/index.md
|
||||
ln -s ../../../$dir_path/$fname.jpg content/blog/$fname
|
||||
|
||||
break
|
||||
done;
|
||||
|
||||
echo "Formatting news..."
|
||||
@@ -146,7 +161,7 @@ do
|
||||
move_below image: category: $file
|
||||
|
||||
# Change field names
|
||||
sed -i "" "s|category:|categories:|g" "$file"
|
||||
sed -i "" "s|category:|news-category:|g" "$file"
|
||||
sed -i "" "s|created:|date:|g" "$file"
|
||||
sed -i "" "s|excerpt:|description:|g" "$file"
|
||||
sed -i "" "s| ---|---|g" "$file"
|
||||
@@ -155,10 +170,17 @@ do
|
||||
sed -i "" "s|image: ./|extra:\\
|
||||
imgPath: |g" "$file"
|
||||
|
||||
mv $file ${file%/*}/index.md
|
||||
mv ${file%/*} content/newsroom
|
||||
add_tab "tags" $file
|
||||
add_tab "news-category" $file
|
||||
|
||||
break
|
||||
dir_path=${file%/*}
|
||||
fname=${dir_path##*/}
|
||||
mkdir content/newsroom/$fname
|
||||
ln -s ../../../$file content/newsroom/$fname/index.md
|
||||
ln -s ../../../$dir_path/$fname.jpg content/newsroom/$fname
|
||||
|
||||
done;
|
||||
|
||||
# mickey malul people taxonomy should be mickey_malul
|
||||
# kristof's categories are not formatted correctly
|
||||
# zero people it is the future blog bug
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,8 +2,11 @@
|
||||
{% block content %}
|
||||
|
||||
{% if page.taxonomies.people %}
|
||||
{% set people = get_section(path="people/_index.md") %}
|
||||
{% if people.pages is containing(page.taxonomies.people[0]) %}
|
||||
{% set author_path = 'people/' ~ page.taxonomies.people[0] ~ '/index.md' %}
|
||||
{% set author = get_page(path=author_path) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Default page template for blog posts and basic informative markdown files -->
|
||||
|
||||
@@ -17,6 +17,9 @@ and a side nav for category and featured post navigation
|
||||
{%- set_global featured = page %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% if not featured %}
|
||||
{%- set_global featured = section.pages[0] %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% include "partials/featuredBlog.html" %}
|
||||
|
||||
@@ -17,6 +17,9 @@ and a side nav for category and featured post navigation
|
||||
{%- set_global featured = page %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% if not featured %}
|
||||
{%- set_global featured = section.pages[0] %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% include "partials/featuredNews.html" %}
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
<!-- Takes the path of a page and checks if it exists
|
||||
- if exists sets the page
|
||||
-->
|
||||
{% macro get_if_exists(path, type="text") %}
|
||||
{% set pages_str = people.pages | json_encode() | as_str %}
|
||||
{% if pages_str is containing(person.name) %}
|
||||
{% set page = get_page(path=page_path) %}
|
||||
{% endif %}
|
||||
{{ page }}
|
||||
{% endmacro get_if_exists %}
|
||||
|
||||
{% macro page_list(type="text") %}
|
||||
<div id="list"></div>
|
||||
{% if section.extra.group_pages_by %}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
{% if post.date %}
|
||||
{% if post.taxonomies.people %}
|
||||
{% set people = get_section(path="people/_index.md") %}
|
||||
{% set pages_str = people.pages | json_encode() | as_str %}
|
||||
{% if pages_str is containing(post.taxonomies.people[0]) %}
|
||||
{% set author_path = 'people/' ~ post.taxonomies.people[0] ~ '/index.md' %}
|
||||
{% set author = get_page(path=author_path) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="flex flex-col rounded-lg shadow-lg overflow-hidden">
|
||||
|
||||
@@ -18,10 +18,14 @@
|
||||
<div class="mt-12 grid gap-5 max-w-lg mx-auto lg:grid-cols-2 xl:grid-cols-4 lg:max-w-none">
|
||||
{% for person in terms %}
|
||||
{% set page_path = person.path ~ 'index.md' | replace(from='-', to='_') | trim_start_matches(pat="/") %}
|
||||
{% set people = get_section(path="people/_index.md") %}
|
||||
{% set pages_str = people.pages | json_encode() | as_str %}
|
||||
{% if pages_str is containing(person.name) %}
|
||||
{% set page = get_page(path=page_path) %}
|
||||
{% if page.extra.private >= 0 %}
|
||||
{% include "partials/person_card.html" %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<hr class="mt-6" />
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
{% block content %}
|
||||
|
||||
{% set page_path = term.path ~ 'index.md' | replace(from='-', to='_') | trim_start_matches(pat="/") %}
|
||||
{% set page = get_page(path=page_path) %}
|
||||
{% set people = get_section(path="people/_index.md") %}
|
||||
{% set pages_str = people.pages | json_encode() | as_str %}
|
||||
{% if pages_str is containing(term.name) %}
|
||||
{% set page = get_page(path=page_path) %}
|
||||
|
||||
|
||||
<div class="container sm:pxi-0 lg:w-5/6 mx-auto min-h-screen overflow-x-hidden pt-24">
|
||||
<div class="flex flex-row flex-wrap items-start mx-4 sm:mx-0">
|
||||
@@ -47,5 +51,6 @@
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user