Skip to content

Commit

Permalink
sponsors revamped
Browse files Browse the repository at this point in the history
  • Loading branch information
pablouser1 committed Jan 9, 2025
1 parent 968dcc0 commit 3a7bfa0
Show file tree
Hide file tree
Showing 13 changed files with 157 additions and 50 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@ jobs:
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'

- name: Build
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Install NPM dependencies
run: npm --prefix ./themes/blowfish install
- name: Build custom Tailwind
run: npm run build
- name: Build website
run: hugo --minify
env:
# For maximum backward compatibility with Hugo modules
Expand All @@ -37,4 +45,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./public
publish_dir: ./public
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ future-content/*
#blowfish generated files
resources/_gen
public
assets/css/compiled

# OS generated files
.DS_Store
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Hackers Week
## Dependencias
La página de la Hackers Week está basada en **Hugo** con el tema de **Blowfish**.

Para poder compilar los estilos personalizados de Tailwind necesitas **NodeJS** y **NPM**

### Tailwind
Ya que la página web actual tiene modificaciones personalizadas, es necesario ejecutar los siguientes comandos primero.

```bash
cd ./themes/blowfish
npm install
cd ../../
npm run build
```

Esto generará un archivo `main.css` en la carpeta `assets/css/compiled`

## Desarrollo
### Iniciar en desarrollo
```
Expand Down Expand Up @@ -39,4 +54,4 @@ Para construir el sitio web de Hugo deberás ejecutar el siguiente comando:
```
hugo --minify
```
, el resultado, los archivos de la página web, se depositarán en la carpeta public, aunque el resultado no funciona si no está siendo ejecutado desde un servidor.
, el resultado, los archivos de la página web, se depositarán en la carpeta public, aunque el resultado no funciona si no está siendo ejecutado desde un servidor.
5 changes: 0 additions & 5 deletions config/_default/menus.es.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
# parent = "Eventos"
# weight = 22

[[main]]
name = "Patrocinadores"
pageRef = "sponsors"
weight = 23

[[main]]
name = "Prensa"
pageRef = "press-kit"
Expand Down
38 changes: 38 additions & 0 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,44 @@ forgejoDefaultServer = "https://v8.next.forgejo.org"
cardViewScreenWidth = false
layoutBackgroundBlur = false # only used when layout equals background

[sponsors]
enabled = true
spam = true
spamPath = "/announcements/call-for-papers-24-25/#colaboración--sponsors"
[[sponsors.ranks]]
name = "Diamante"
emoji = "🔵"
textSize = "xl"
imageSize = "148px"
[[sponsors.ranks.members]]
url = "https://hackersweek.es"
image = "img/author-logo.png"
[[sponsors.ranks.members]]
url = "https://hackersweek.es"
image = "img/author-logo.png"
[[sponsors.ranks.members]]
url = "https://hackersweek.es"
image = "img/author-logo.png"
[[sponsors.ranks]]
name = "Platino"
emoji = "⚪️"
textSize = "lg"
imageSize = "128px"
[[sponsors.ranks.members]]
url = "https://hackersweek.es"
image = "img/author-logo.png"
[[sponsors.ranks.members]]
url = "https://hackersweek.es"
image = "img/author-logo.png"
[[sponsors.ranks]]
name = "Oro"
emoji = "🟡"
textSize = "base"
imageSize = "108px"
[[sponsors.ranks.members]]
url = "https://hackersweek.es"
image = "img/author-logo.png"

[article]
showDate = true
showViews = false
Expand Down
41 changes: 0 additions & 41 deletions content/sponsors/index.md

This file was deleted.

5 changes: 5 additions & 0 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sponsors:
name: Sponsors
rank: Rank
thanks: This event wouldn't be possible without the help of our sponsors.
spam: Would you like to sponsor us? Contact us below!
5 changes: 5 additions & 0 deletions i18n/es.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sponsors:
name: Patrocinadores
rank: Plan
thanks: La Hackers Week no sería posible sin la ayuda de nuestros patrocinadores.
spam: ¿Te gustaría patrocinarnos? ¡Contáctanos!
42 changes: 42 additions & 0 deletions layouts/partials/home/profile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<article class="{{ if not .Site.Params.homepage.showRecent }}
h-full
{{ end }} flex flex-col items-center justify-center text-center">
<header class="relative px-1 py-1 flex flex-col items-center mb-3">
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144" alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
<h1 class="text-4xl font-extrabold">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="text-xl text-neutral-500 dark:text-neutral-400">
{{ . | markdownify }}
</h2>
{{ end }}
<div class="mt-1 text-2xl">
{{ partialCached "author-links.html" . }}
</div>
</header>
<section class="prose dark:prose-invert">{{ .Content }}</section>
</article>
<section>
{{ partial "recent-articles/main.html" . }}
</section>
{{ if and (isset .Site.Params.Sponsors "enabled") (eq .Site.Params.Sponsors.Enabled true) }}
<section>
{{ partial "sponsors/main.html" . }}
</section>
{{ end }}
6 changes: 6 additions & 0 deletions layouts/partials/sponsors/item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{ $image := resources.Get .context.image }}

<a href="{{ .context.url }}">
<img width="{{ .size }}" height="{{ .size }}" class="nozoom" src="{{ $image.RelPermalink }}" />
</a>
12 changes: 12 additions & 0 deletions layouts/partials/sponsors/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ $imageSize := .imageSize }}
<h3 class="mt-8 text-{{ .textSize }} font-extrabold mb-10">
<span>{{ .emoji }}</span>
<span>{{ i18n "sponsors.rank" }}</span>
<span>{{ .name }}</span>
</h3>

<section class="grid gap-10 grid-flow-col auto-cols-max justify-center">
{{ range .members }}
{{ partial "sponsors/item.html" (dict "context" . "size" $imageSize) }}
{{ end }}
</section>
13 changes: 13 additions & 0 deletions layouts/partials/sponsors/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<h2 class="mt-8 text-2xl font-extrabold mb-4">{{ i18n "sponsors.name" }}</h2>
<p>{{ i18n "sponsors.thanks" }}</p>

{{ if and (isset .Site.Params.Sponsors "spam") (eq .Site.Params.Sponsors.Spam true) }}
<p class="mt-4 mb-4">{{ i18n "sponsors.spam" }}</p>
<a href="{{ .Site.Params.Sponsors.SpamPath }}" class="!rounded-md bg-primary-600 px-4 py-2 !text-neutral !no-underline hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700" role="button">
C4P
</a>
{{ end }}

{{ range .Site.Params.Sponsors.Ranks }}
{{ partial "sponsors/list.html" . }}
{{ end }}
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "hackersweekweb",
"scripts": {
"server": "hugo server -b http://localhost -p 8000",
"dev": "NODE_ENV=development ./themes/blowfish/node_modules/tailwindcss/lib/cli.js -c ./themes/blowfish/tailwind.config.js -i ./themes/blowfish/assets/css/main.css -o ./assets/css/compiled/main.css --jit -w",
"build": "NODE_ENV=production ./themes/blowfish/node_modules/tailwindcss/lib/cli.js -c ./themes/blowfish/tailwind.config.js -i ./themes/blowfish/assets/css/main.css -o ./assets/css/compiled/main.css --jit"
}
}

0 comments on commit 3a7bfa0

Please sign in to comment.