Skip to content

Commit

Permalink
feat: next version (#114)
Browse files Browse the repository at this point in the history
* feat: start the six version of the blog, and merge it with my resume website

* feat: add sitemap and deployment script

* fix: fix config vars

* fix: cleanup
  • Loading branch information
nirgn975 authored Oct 6, 2022
1 parent 8707c03 commit c4e50e1
Show file tree
Hide file tree
Showing 208 changed files with 27,862 additions and 1,028 deletions.
5 changes: 0 additions & 5 deletions .firebaserc

This file was deleted.

58 changes: 25 additions & 33 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,32 @@ on:
schedule:
- cron: "0 7 1 * *" # Every first day on every month at 7:00 AM UTC (10:00 AM Israel time).

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true

- name: Build
run: hugo --minify -e production
- name: Checkout your repository using git
uses: actions/checkout@v2
- name: Install, build, and upload your site output
uses: withastro/action@v0
# with:
# path: . # The root location of your Astro project inside the repository. (optional)
# node-version: 16 # The specific version of Node that should be used to build your site. Defaults to 16. (optional)
# package-manager: yarn # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
channelId: live
projectId: stories-of-a-lifelong-student
env:
FIREBASE_CLI_PREVIEWS: hostingchannels

- name: Update index.json To Algolia
run: |
npm install -D atomic-algolia
npx atomic-algolia
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
ALGOLIA_INDEX_NAME: index.json
ALGOLIA_INDEX_FILE: ./public/index.json
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
31 changes: 0 additions & 31 deletions .github/workflows/continuous-integration.yml

This file was deleted.

76 changes: 14 additions & 62 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,67 +1,19 @@
# build output
dist/
.output/

# Created by https://www.gitignore.io/api/git,hugo,macos,firebase
# Edit at https://www.gitignore.io/?templates=git,hugo,macos,firebase
# dependencies
node_modules/

### Firebase ###
.idea
**/node_modules/*
**/.firebaserc
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

### Firebase Patch ###
.runtimeconfig.json
.firebase/
# environment variables
.env
.env.production

### Git ###
# Created by git for backups. To disable backups in Git:
# $ git config --global mergetool.keepBackup false
*.orig

# Created by git when using merge tools for conflicts
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
*_BASE_*.txt
*_LOCAL_*.txt
*_REMOTE_*.txt

### Hugo ###
# Generated files by hugo
/public/
/resources/_gen/

# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux

### macOS ###
# General
# macOS-specific files
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.gitignore.io/api/git,hugo,macos,firebase
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

49 changes: 49 additions & 0 deletions READM2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Stories of a Lifelong Student

[![CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-blue.svg)](http://creativecommons.org/licenses/by/4.0/) ![Continuous Deployment](https://github.com/nirgn975/stories-of-a-lifelong-student/workflows/Continuous%20Deployment/badge.svg?branch=main) [![Donate](https://img.shields.io/badge/PayPal-Donate-lightgrey.svg)](https://www.paypal.me/nirgn/2)

> Stories of a Lifelong Student is the fourth interaction of my private blog. I always wanted to open source as much as I can in my blog, and when I decided to rebuilt and design it, it was the perfect chance to move to GitHub and open source the code, the images, the posts themselves, and especially my process.
>
> All of the posts are written by me, but I'm more then happy to receive some PRs to correct my grammar, a misleading information, an update to something, or basically everything!
>
> All the things I write in this post are my own thoughts and personal experiments. I'm not responsible for anything you might try to do, and not encourages anything that is not within the law. All the info in the posts are for learning and expanding horizons only!
>
> The posts are usually about computer science (data structures, algorithms, computer networks, operating system, and machine learning), open source (linux, git, code contribution), software development (programming, programming languages, frameworks, design patterns, and architecture), security information (pen testing and whitehat hacking), android and reverse engineering.
## Prerequisites

To install this project, you'll need the following things installed on your machine.

1. [Hugo](https://gohugo.io/)
2. [NodeJS](http://nodejs.org) - use the installer.
3. [Firebase CLI](https://github.com/firebase/firebase-tools).

## Development

1. Clone this repo

```shell
$ git clone --recurse-submodules git@github.com:nirgn975/stories-of-a-lifelong-student.git
```

2. Inside the directory, run

```shell
$ export HUGO_ENV=devlopment
$ hugo serve -D
```

## Deployment

First you need firebase

```shell
$ npm install -g firebase-tools
```

Then easily deploy the blog

```shell
$ export HUGO_ENV=production
$ hugo && firebase deploy
```
74 changes: 41 additions & 33 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
# Stories of a Lifelong Student
# Welcome to [Astro](https://astro.build)

[![CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-blue.svg)](http://creativecommons.org/licenses/by/4.0/) ![Continuous Deployment](https://github.com/nirgn975/stories-of-a-lifelong-student/workflows/Continuous%20Deployment/badge.svg?branch=main) [![Donate](https://img.shields.io/badge/PayPal-Donate-lightgrey.svg)](https://www.paypal.me/nirgn/2)
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)

> Stories of a Lifelong Student is the fourth interaction of my private blog. I always wanted to open source as much as I can in my blog, and when I decided to rebuilt and design it, it was the perfect chance to move to GitHub and open source the code, the images, the posts themselves, and especially my process.
>
> All of the posts are written by me, but I'm more then happy to receive some PRs to correct my grammar, a misleading information, an update to something, or basically everything!
>
> All the things I write in this post are my own thoughts and personal experiments. I'm not responsible for anything you might try to do, and not encourages anything that is not within the law. All the info in the posts are for learning and expanding horizons only!
>
> The posts are usually about computer science (data structures, algorithms, computer networks, operating system, and machine learning), open source (linux, git, code contribution), software development (programming, programming languages, frameworks, design patterns, and architecture), security information (pen testing and whitehat hacking), android and reverse engineering.
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## Prerequisites
![basics](https://user-images.githubusercontent.com/4677417/186188965-73453154-fdec-4d6b-9c34-cb35c248ae5b.png)

To install this project, you'll need the following things installed on your machine.
Features:

1. [Hugo](https://gohugo.io/)
2. [NodeJS](http://nodejs.org) - use the installer.
3. [Firebase CLI](https://github.com/firebase/firebase-tools).
- ✅ Minimal styling (make it your own!)
- ✅ 100/100 Lighthouse performance
- ✅ SEO-friendly with canonical URLs and OpenGraph data
- ✅ Sitemap support
- ✅ RSS Feed support
- ✅ Markdown & MDX support

## Development
## 🚀 Project Structure

1. Clone this repo
Inside of your Astro project, you'll see the following folders and files:

```shell
$ git clone --recurse-submodules git@github.com:nirgn975/stories-of-a-lifelong-student.git
```
/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
```

2. Inside the directory, run
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

```shell
$ export HUGO_ENV=devlopment
$ hugo serve -D
```
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

## Deployment
Any static assets, like images, can be placed in the `public/` directory.

First you need firebase
## 🧞 Commands

```shell
$ npm install -g firebase-tools
```
All commands are run from the root of the project, from a terminal:

Then easily deploy the blog
| Command | Action |
| :--------------------- | :------------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro preview` |
| `npm run astro --help` | Get help using the Astro CLI |

```shell
$ export HUGO_ENV=production
$ hugo && firebase deploy
```
## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 0 additions & 26 deletions archetypes/default.md

This file was deleted.

8 changes: 0 additions & 8 deletions assets/css/_custom.scss

This file was deleted.

14 changes: 14 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from "astro/config";
import { astroImageTools } from "astro-imagetools";
import tailwind from "@astrojs/tailwind";
import sitemap from "@astrojs/sitemap";
import partytown from "@astrojs/partytown";

import mdx from "@astrojs/mdx";

// https://astro.build/config
export default defineConfig({
site: "https://nir.galons.io",
base: "/portfolio",
integrations: [sitemap(), tailwind(), astroImageTools, partytown(), mdx()],
});
Loading

0 comments on commit c4e50e1

Please sign in to comment.