Skip to content

Commit

Permalink
Tutorial de Python
Browse files Browse the repository at this point in the history
  • Loading branch information
misaelnieto committed Aug 30, 2024
1 parent a10ce50 commit 0faa1c1
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 10 deletions.
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ defaults:
hero_darken: true
layout: tutorial
show_sidebar: false
permalink: /:collection/:name
permalink: /:collection/:path
author: "Noe Nieto"

# Configuration for collections/codice
collections:
Expand Down
77 changes: 73 additions & 4 deletions _layouts/tutorial.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
{% assign tutorial_data = site.data.tutoriales | where: 'name', page.tutorial | first %}
{% assign chapters = site.tutoriales | where: 'tutorial', page.tutorial %}

{% for c in chapters %}
{% if c.relative_path == page.relative_path %}
{% if forloop.first %}
{% assign next_chapter = chapters[forloop.index].url %}
{% elsif forloop.last %}
{% assign minus_one = forloop.index0 | minus: 1 %}
{% assign previous_chapter = chapters[minus_one].url %}
{% else %}
{% assign minus_one = forloop.index0 | minus: 1 %}
{% assign previous_chapter = chapters[minus_one].url %}
{% assign next_chapter = chapters[forloop.index].url %}
{% endif %}
{% break %}
{% endif %}
{% endfor %}

<!doctype html>
{% assign has_left_sidebar = true %}

Expand Down Expand Up @@ -30,12 +49,11 @@
<div class="column is-4-desktop is-4-tablet">
<aside class="menu">
<p class="menu-label">
{% assign tutorial_data = site.data.tutoriales | where: 'name', page.tutorial | first %}
{{ tutorial_data.title }}
</p>
{% assign f_tutoriales = site.tutoriales | where: 'tutorial', page.tutorial %}

<ul class="menu-list">
{% for tuto in f_tutoriales %}
{% for tuto in chapters %}
<li>
<a
href="{{tuto.url}}"
Expand Down Expand Up @@ -63,7 +81,53 @@
{% include showcase.html %}
{% include sponsors.html %}
{% include gallery.html %}
{{ content }}

<div class="content">
<p>Published: {{ page.date | date: '%b %-d, %Y' }} by {{ page.author }}</p>

{% if page.series %}
{% include series.html %}
{% endif %}

{{ content }}
</div>
<div class="columns my-6">
{% if previous_chapter %}
{% if next_chapter %}
<div class="column is-6"><a href="{{previous_chapter}}" class="button is-link">Anterior</a></div>
<div class="column is-6 has-text-right">
<a href="{{ next_chapter }}" class="button is-link">Siguiente</a>
</div>
{% else %}
<div class="column is-12">
<a href="{{ previous_chapter }}" class="button is-link">Anterior</a>
</div>
{% endif %}

{% elsif next_chapter %}
<div class="column is-12 has-text-right">
<a href="{{ next_chapter }}" class="button is-link">Siguiente</a>
</div>
{% endif %}
</div>

<div class="tags my-4">
{% for tag in page.tags %}
{% include tag.html tag=tag %}
{% endfor %}
</div>

{% unless site.hide_share_buttons %}
<div class="my-4">
{% include share-buttons.html %}
</div>
{% endunless %}

{% if site.disqus.shortname %}
<div class="my-4">
{% include disqus.html %}
</div>
{% endif %}
</div>
{% if site.posts and page.show_sidebar %}
<div class="column is-4-desktop is-4-tablet">
Expand All @@ -78,5 +142,10 @@
{% endunless %}
<script src="{{ site.baseurl }}/assets/js/app.js" type="text/javascript"></script>
{%- include footer-scripts.html -%}
<script src="https://modularizer.github.io/pyprez/pyprez.min.js" type="text/javascript"></script>
<script>
pyprez.then((){
});
</script>
</body>
</html>
23 changes: 23 additions & 0 deletions _tutoriales/python-101/00_introduccion_rapida.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Introducción rápida
subtitle: Python, en menos de 1 minuto
tutorial: python-101
index: 0
---

## ¿Qué es Python?

Python es un lenguaje de programación muy fácil de aprender y usar, perfecto para principiantes. Es como darle instrucciones a una computadora usando palabras simples. Con Python, puedes crear juegos, aplicaciones y muchas cosas divertidas.

Aquí tienes un ejemplo sencillo de un programa en Python que pide tu nombre y te saluda:

```run-pyprez
# Pide tu nombre
nombre = input("¿Cómo te llamas? ")
# Te saluda
print("¡Hola, " + nombre + "!")
```

Este código le pregunta a la computadora tu nombre y luego te saluda. ¡Sigue leyendo para descubrir más sobre lo que puedes hacer con Python!

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Qué es Python?
subtitle: Para qué sirve? Con qué se come?
title: Historia de Python
subtitle: ¿Para qué sirve? ¿Con qué se come?
tutorial: python-101
leccion: 0
index: 1
---

## Breve historia de Python
Expand Down
4 changes: 2 additions & 2 deletions _tutoriales/python-101/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: El Códice Python 101
subtitle: ¡Bienvenido al Códice Python 101!
title: Python 101
subtitle: Introducción al curso
tutorial: python-101
index: 0
---
Expand Down

0 comments on commit 0faa1c1

Please sign in to comment.