Skip to content

Commit

Permalink
Merge pull request #3 from MediaPlay-Discord/hugo
Browse files Browse the repository at this point in the history
Migrate to Hugo
  • Loading branch information
Linerly authored Apr 19, 2024
2 parents c6fb341 + e127ea4 commit 58dd5b6
Show file tree
Hide file tree
Showing 188 changed files with 4,063 additions and 45 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.124.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Empty file added .hugo_build.lock
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++
8 changes: 8 additions & 0 deletions content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
date = 2024-04-19T06:32:18+07:00
draft = true
+++

# Welcome to MediaPlay!

*This website is rebuilt with Hugo. Stay tuned for more updates!*
8 changes: 8 additions & 0 deletions content/blog/welcome-to-the-mediaplay-blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = 'Welcome to the MediaPlay blog!'
date = 2024-04-19T06:44:53+07:00
author = 'Linerly'
discord = '@linerly'
+++

This will be the place where MediaPlay members can write their own article in here! It used to be separated from the main site, but with Hugo, it's all in one place now.
12 changes: 12 additions & 0 deletions content/community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
+++
title = 'Community'
date = 2024-04-19T06:36:53+07:00
+++

*If you're new to here, welcome! 👋*

MediaPlay is a gaming and chatting lounge community created by TechNewVideo—also known as Techy—to bring people all around the world in this community and keep us connected in this world as possible.

We create projects to help us and other people who is interested in the community to create things together.

We welcome all people from different kinds of backgrounds no matter how different and unique they are. 🙂
24 changes: 0 additions & 24 deletions css/main.css

This file was deleted.

5 changes: 5 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
baseURL = 'https://mediaplay-discord.github.io/'
languageCode = 'en-us'
title = 'MediaPlay'
disableKinds = ["taxonomy", "term"]
summaryLength = 12
4 changes: 2 additions & 2 deletions 404.html → layouts/_default/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<meta name="theme-color" content="#00B0F0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>404 · MediaPlay Discord</title>
<title>404 - MediaPlay Discord</title>
<link rel="stylesheet" href="/css/main.css" />
<link rel="stylesheet" href="/css/navbar.css" />
<link rel="stylesheet" href="/css/scrollBar.css" />
Expand All @@ -34,7 +34,7 @@ <h1 style="text-align: center; font-size: 5em"><strong>404</strong></h1>
/>

<h2 style="text-align: center; font-size: 1.75em">
The cubes couldn't find the page you wanted...
<i>The cubes couldn't find the page you wanted...</i>
</h2>

<hr />
Expand Down
128 changes: 128 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Web manifest -->
<link rel="manifest" href="/manifest.json" />

<!--Metadata-->
<meta charset="UTF-8" />
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta
name="keywords"
content="MediaPlay"
/>
<meta name="author" content="Linerly" />
<meta name="theme-color" content="#00B0F0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>{{ block "title" . }}{{ $title := site.Title }}{{ if not .IsHome }}{{ $title = printf "%s - %s" .Title site.Title }}{{ end }}{{ $title }}{{ end }}</title>
<link rel="stylesheet" href="/css/main.css" />
<link rel="stylesheet" href="/css/navbar.css" />
<link rel="stylesheet" href="/css/scrollBar.css" />

<!--Favicon-->
<link rel="icon" href="/assets/MPD-Favicon.ico" type="image/x-icon" />

<!--Message for showing if JS is disabled-->
<noscript>
<style>
figure noscript {
top: 0;
left: 0;
position: absolute;
}
</style>

<style>
#enable-js {
margin: 0;
padding: 12px 15px;
background-color: #ffc107;
color: #000;
text-align: center;
font-family: "Figtree", sans-serif;
font-size: 13px;
}
</style>
<p id="enable-js">
🦮 Sorry, some parts of the website didn't load correctly. Make sure to
enable JavaScript in your browser.
</p>
</noscript>
</head>

<body>
<div class="container">
<div class="logo">
<a href="/"><img src="/assets/MediaPlay_Text_Logo.png" alt="logo" /></a>
</div>
<div class="navbar">
<div class="icon-bar" onclick="Show()">
<i></i>
<i></i>
<i></i>
</div>

<ul style="z-index: 1" id="nav-lists">
<li class="close">
<span
onclick="Hide()"
style="
border-color: #0d1347;
color: #ffffff;
font-size: 50px;
margin-left: 5px;
margin-top: 10px;
"
></span
>
</li>
<li><a style="margin-left: 15px" href="/">Home</a></li>
<li><a style="margin-left: 15px" href="/community">Community</a></li>
<li><a style="margin-left: 15px" href="/blog">Blog</a></li>
<li><a style="margin-left: 15px" href="https://mediaplay-discord.fandom.com">Wiki ↗</a></li>
</ul>
</div>
</div>

<div class="body">
{{ block "main" . }}
{{ end }}
</div>

<script>
var navList = document.getElementById("nav-lists");

function Show() {
navList.classList.add("_Menus-show");
}

function Hide() {
navList.classList.remove("_Menus-show");
}
</script>
</body>

<footer style="text-align: center;">
<p>
<a
href="https://github.com/MediaPlay-Discord/mediaplay-discord.github.io"
target="_blank"
>Source Code</a
>
|
<a
href="https://github.com/MediaPlay-Discord/mediaplay-discord.github.io/commits"
target="_blank"
>Website Changes</a
>
|
<a
href="https://docs.google.com/document/d/1lh1AACqVtivyXc0im6eSgQMX8fzM2MUdoBRpElFASbM"
target="_blank"
>MPDictionary</a
>
</p>
</div>
</footer>
</html>
11 changes: 11 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ define "main" }}

<h1 style="text-align: center; font-size: 24pt;">{{ .Title }}</h1>
<p style="text-align: center;">by {{ .Params.Author }} (<code>{{ .Params.discord }}</code>)</p>
<p style="text-align: center;">around {{ .ReadingTime }} {{ cond (eq .ReadingTime 1) "minute" "minutes" }} · published on {{ .Date.Format "2006-01-02" }} · {{ .WordCount }} words</p>

<hr>

{{ .Content }}

{{ end }}
13 changes: 13 additions & 0 deletions layouts/blog/blog.html

Large diffs are not rendered by default.

Loading

0 comments on commit 58dd5b6

Please sign in to comment.