Skip to content

Commit

Permalink
Fix conflig
Browse files Browse the repository at this point in the history
  • Loading branch information
yabirgb committed Apr 11, 2020
2 parents 6d85658 + bf19f94 commit 60b876b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ arcade build
arcade watch
```

## Themes

Currently only the baseline theme is available. You can download it [here](https://github.com/yabirgb/arcade/releases/download/0.0.5/baseline.zip)

Made with :heart: and :snake: by Yábir Benchakhtir

## Credit
Expand Down
7 changes: 4 additions & 3 deletions arcade_generator/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ def init() -> None:

# Copy basic theme
local_path = os.path.dirname(os.path.abspath(__file__))
copytree(os.path.join(local_path,'themes/baseline'), os.path.join(calling_path, 'themes', 'baseline'))
#copytree(os.path.join(local_path,'themes/baseline'), os.path.join(calling_path, 'themes', 'baseline'))

click.echo("Project created! Modify the arcade.yaml configuration file")
click.echo("Don't forget to download a theme for your blog before starting. Visit https://github.com/yabirgb/arcade for more info")


@click.command()
Expand Down Expand Up @@ -50,6 +51,6 @@ def watch() -> None:
render_content(base_path, content, theme)
copy_static_assets(base_path, theme)

server.watch(content_folder, shell("python arcade/main.py build", cwd=base_path))
server.watch(theme_folder, shell("python arcade/main.py build", cwd=base_path))
server.watch(content_folder, shell("arcade build", cwd=base_path))
server.watch(theme_folder, shell("arcade build", cwd=base_path))
server.serve(root="public")
10 changes: 8 additions & 2 deletions arcade_generator/create_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def generate_folder_structure(
base_path: str, folders=required_folders.values()
base_path: str, folders=required_folders
) -> None:
"""
Create folder structure of arcade in the
Expand All @@ -16,9 +16,15 @@ def create_folder(path):
if not os.path.exists(path):
os.makedirs(path)

for folder in folders:
for folder in folders.values():
create_folder(os.path.join(base_path, folder))

# create index file
with open(os.path.join(base_path, folders["content"], 'index.md'), 'w') as f:
f.write("# Welcome to the arcade")




def create_config_file(
base_path: str,
Expand Down
3 changes: 2 additions & 1 deletion arcade_generator/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def render_content(base_path:str,
# TODO: Overwrite this hardcoded constant
get = min(len(data), 10)
post_data['posts'] = [x.to_dict() for x in
sorted(data[:get], reverse=True) if not x.is_index]
sorted([x for x in data if not x.is_index][:get], reverse=True) if not x.is_index]

render = index_tmpl.render(post_data)

Expand All @@ -117,6 +117,7 @@ def render_content(base_path:str,
lambda x: x.to_dict(),
sorted([x for x in data if not x.is_index], reverse=True))
)

content['config'] = index_config
render = history.render(content)

Expand Down
2 changes: 1 addition & 1 deletion themes/baseline/footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<footer>
<footer>
{% for net, social in config.social.items() %}
{% if social != None %}
<a href="{{social.url}}"><i class="fa {{social.icon}}" aria-hidden="true"></i></a>
Expand Down
2 changes: 2 additions & 0 deletions themes/baseline/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1 class="title">{{config.page_name}}</h1>

{{post}}

{% if posts %}
<h3>Latest Posts</h3>
<ul id='post-list'>
{% for post in posts %}
Expand All @@ -27,4 +28,5 @@ <h3>Latest Posts</h3>
</ul>

<a href="/history">See more...</a>
{% endif %}
{% endblock content %}

0 comments on commit 60b876b

Please sign in to comment.