Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #345 from 30-seconds/rebranding-21
Browse files Browse the repository at this point in the history
Resolves #344
Resolves #337
Resolves #339
Resolves #331
Resolves #330
Resolves #251
Resolves #343
Resolves #346
Resolves #324
  • Loading branch information
Chalarangelo committed Jun 17, 2021
2 parents 96f4867 + e9b120c commit 7b0a57a
Show file tree
Hide file tree
Showing 157 changed files with 911 additions and 1,821 deletions.
2 changes: 1 addition & 1 deletion .env.development
@@ -1,2 +1,2 @@
ENV=development
CACHE_KEY=dev_2020_08
CACHE_KEY=dev_2021_06
2 changes: 1 addition & 1 deletion .env.production
@@ -1,2 +1,2 @@
ENV=production
CACHE_KEY=30swp20200826234402
CACHE_KEY=30swp20210617172504
2 changes: 1 addition & 1 deletion .env.test
@@ -1,2 +1,2 @@
ENV=test
CACHE_KEY=test_2021_04
CACHE_KEY=test_2021_06
14 changes: 0 additions & 14 deletions .github/config.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/lock.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/stale.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .gitmodules
Expand Up @@ -3,11 +3,6 @@
url = https://github.com/30-seconds/30-seconds-of-python
branch = master
update = checkout
[submodule "content/sources/30php"]
path = content/sources/30php
url = https://github.com/30-seconds/30-seconds-of-php
branch = master
update = checkout
[submodule "content/sources/30code"]
path = content/sources/30code
url = https://github.com/30-seconds/30-seconds-of-code
Expand All @@ -23,26 +18,11 @@
url = https://github.com/30-seconds/30-seconds-of-react
branch = master
update = checkout
[submodule "content/sources/30csharp"]
path = content/sources/30csharp
url = https://github.com/30-seconds/30-seconds-of-csharp
branch = master
update = checkout
[submodule "content/sources/30blog"]
path = content/sources/30blog
url = https://github.com/30-seconds/30-seconds-blog
branch = master
update = checkout
[submodule "content/sources/30dart"]
path = content/sources/30dart
url = https://github.com/30-seconds/30-seconds-of-dart
branch = master
update = checkout
[submodule "content/sources/30golang"]
path = content/sources/30golang
url = https://github.com/30-seconds/30-seconds-of-golang
branch = master
update = checkout
[submodule "content/configs"]
path = content/configs
url = https://github.com/30-seconds/30-seconds-content
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
@@ -1,9 +1,9 @@
# Contribution guidelines

**30 seconds** is a community effort, so feel free to contribute in any way you can. Every contribution helps!
**30 seconds of code** is a community effort, so feel free to contribute in any way you can. Every contribution helps!

Here's what you can do to help:

- [Open issues](https://github.com/30-seconds/30-seconds-web/issues/new) for any bugs with the website, new features you want to request or changes you would like to see in the future. Try to use the appropriate template and provide as much information as possible.
- Submit [pull requests](https://github.com/30-seconds/30-seconds-web/pulls) for changes to the website, bug fixes and new features. Remember to reference any open issues your pull request is related to and provide any relevant information.
- Submit issues or pull requests for similar topics in relation to content to the appropriate content repository under the [30-seconds organization](https://github.com/30-seconds).
- Submit issues or pull requests for similar topics in relation to content to the appropriate content repository under the [30 seconds of code organization](https://github.com/30-seconds).
4 changes: 2 additions & 2 deletions README.md
@@ -1,8 +1,8 @@
[![Logo](/assets/logo.png)](https://www.30secondsofcode.org/)

# 30 seconds website platform
# 30 seconds of code website platform

Website infrastructure for [30-seconds](https://github.com/30-seconds) projects.
Website infrastructure for [30-seconds of code](https://github.com/30-seconds) projects.

Please refer to individual projects for content issues.
This repository contains the source code for the website platform and nothing else.
Binary file modified assets/30s-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/Inter-Italic.woff2
Binary file not shown.
Binary file removed assets/Inter-Medium.woff2
Binary file not shown.
Binary file removed assets/Inter-Regular.woff2
Binary file not shown.
Binary file removed assets/Inter-SemiBold.woff2
Binary file not shown.
Binary file added assets/Inter.var.woff2
Binary file not shown.
Binary file modified assets/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion content/configs
2 changes: 1 addition & 1 deletion content/sources/30blog
2 changes: 1 addition & 1 deletion content/sources/30code
1 change: 0 additions & 1 deletion content/sources/30csharp
Submodule 30csharp deleted from 34003a
2 changes: 1 addition & 1 deletion content/sources/30css
Submodule 30css updated from f83944 to 5ce790
1 change: 0 additions & 1 deletion content/sources/30dart
Submodule 30dart deleted from 71af0b
1 change: 0 additions & 1 deletion content/sources/30golang
Submodule 30golang deleted from 979e8c
1 change: 0 additions & 1 deletion content/sources/30php
Submodule 30php deleted from f524f1
2 changes: 1 addition & 1 deletion content/sources/30python
2 changes: 1 addition & 1 deletion content/sources/30react
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -11,7 +11,6 @@
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/preset-env": "^7.13.15",
"@babel/preset-react": "^7.13.13",
"@chalarangelo/combine-class-names": "^1.0.0",
"@fixture-factory/fixture-factory": "^1.0.1",
"@testing-library/react": "^10.4.8",
"@types/jest": "^26.0.19",
Expand Down
91 changes: 31 additions & 60 deletions public/_redirects
Expand Up @@ -10,7 +10,7 @@
#
# * Redirect replaced/renamed snippets.
# -----------------------------------------------------------------------------
/css/s/easing-variables /blog/s/css-easing-variables 301!
/css/s/easing-variables /articles/s/css-easing-variables 301!
/python/s/count-occurences /python/s/count-occurrences 301!

# -----------------------------------------------------------------------------
Expand All @@ -30,65 +30,36 @@
/php /php/p/1 301!

# -----------------------------------------------------------------------------
# UPDATED LISTING REDIRECTS:
# SORTED LISTING PAGE REDIRECTS:
#
# * Redirect main listing with deprecated order to page 1 of the dedicated
# listing sorted by popularity.
# * Redirect blog listing with deprecated order to page 1 of the blog listing
# sorted by freshness.
# * Redirect alternative sorting listings to page 1 of the dedicated listing.
# -----------------------------------------------------------------------------
/list/e/1/ /list/p/1 301!
/list/e/2/ /list/p/1 301!
/list/e/3/ /list/p/1 301!
/list/e/4/ /list/p/1 301!
/list/e/5/ /list/p/1 301!
/list/e/6/ /list/p/1 301!
/list/e/7/ /list/p/1 301!
/list/e/8/ /list/p/1 301!
/list/e/9/ /list/p/1 301!
/list/e/10/ /list/p/1 301!
/list/e/11/ /list/p/1 301!
/list/e/12/ /list/p/1 301!
/list/e/13/ /list/p/1 301!
/list/e/14/ /list/p/1 301!
/list/e/15/ /list/p/1 301!
/list/e/16/ /list/p/1 301!
/list/e/17/ /list/p/1 301!
/list/e/18/ /list/p/1 301!
/list/e/19/ /list/p/1 301!
/list/e/20/ /list/p/1 301!
/list/e/21/ /list/p/1 301!
/list/e/22/ /list/p/1 301!
/list/e/23/ /list/p/1 301!
/list/e/24/ /list/p/1 301!
/list/a/1/ /list/p/1 301!
/list/a/2/ /list/p/1 301!
/list/a/3/ /list/p/1 301!
/list/a/4/ /list/p/1 301!
/list/a/5/ /list/p/1 301!
/list/a/6/ /list/p/1 301!
/list/a/7/ /list/p/1 301!
/list/a/8/ /list/p/1 301!
/list/a/9/ /list/p/1 301!
/list/a/10/ /list/p/1 301!
/list/a/11/ /list/p/1 301!
/list/a/12/ /list/p/1 301!
/list/a/13/ /list/p/1 301!
/list/a/14/ /list/p/1 301!
/list/a/15/ /list/p/1 301!
/list/a/16/ /list/p/1 301!
/list/a/17/ /list/p/1 301!
/list/a/18/ /list/p/1 301!
/list/a/19/ /list/p/1 301!
/list/a/20/ /list/p/1 301!
/list/a/21/ /list/p/1 301!
/list/a/22/ /list/p/1 301!
/list/a/23/ /list/p/1 301!
/list/a/24/ /list/p/1 301!
/blog/e/1/ /blog/n/1 301!
/blog/e/2/ /blog/n/1 301!
/blog/a/1/ /blog/n/1 301!
/blog/a/2/ /blog/n/1 301!
/blog/n/* /articles/p/1 301!
/blog/e/* /articles/p/1 301!
/blog/a/* /articles/p/1 301!
/list/e/* /list/p/1 301!
/list/a/* /list/p/1 301!
/:lang/a/* /:lang/p/1 301!
/:lang/e/* /:lang/p/1 301!
/:lang/t/:tag/a/* /:lang/t/:tag/p/1 301!
/:lang/t/:tag/e/* /:lang/t/:tag/p/1 301!

# -----------------------------------------------------------------------------
# ARTICLE URL REDIRECTS:
#
# * Redirect all blog urls to new articles urls.
# -----------------------------------------------------------------------------
/blog/* /articles/:splat 301!

# -----------------------------------------------------------------------------
# REMOVED CONTENT REDIRECTS:
#
# * Redirect removed language content to the homepage with a 410 (gone forever).
# -----------------------------------------------------------------------------
/dart/* / 410
/go/* / 410
/php/* / 410
/c-sharp/* / 410

# -----------------------------------------------------------------------------
# UPDATED TAG REDIRECTS:
Expand All @@ -110,12 +81,12 @@ python/t/object/e/1/ /python/t/dictionary/e/1
# -----------------------------------------------------------------------------
# SNIPPET REDIRECTS:
#
# * Redirect an old CSS snippet to a new blog (CSS variables)
# * Redirect an old CSS snippet to a new article (CSS variables)
# * Redirect an old CSS snippet to the CSS listing (CSS calc)
# * Redirect an old JS snippet to its duplicate
# * Redirect a couple of Python snippets to their new URLs
# -----------------------------------------------------------------------------
css/s/custom-variables/ /blog/s/css-variables 301!
css/s/custom-variables/ /articles/s/css-variables 301!
css/s/calc/ /css/p/1 301!
js/s/filter-falsy/ /js/s/compact 301!
python/s/function-name/ /python/s/check-prop 301!
Expand Down
17 changes: 4 additions & 13 deletions src/blocks/adapters/snippetCollectionListing/index.js
Expand Up @@ -10,21 +10,16 @@ export class SnippetCollectionListing {
/**
* Creates a listing from the given SnippetCollection object.
* @param {Snippet} snippet - A snippet to create a context from.
* @param {object} options - Options object, containing the following:
* - `order` - Order segment of the page slug. (default: `'p'`)
* @throws Will throw an error if snippetCollection is not a SnippetCollection.
*/
constructor(snippetCollection, { order = 'p' } = {}) {
constructor(snippetCollection) {
if (!(snippetCollection instanceof SnippetCollection)) {
throw new ArgsError(
"Invalid arguments. 'snippetCollection' must be an instance of 'SnippetCollection'."
);
}

this.snippetCollection = snippetCollection;
this._options = {
order,
};
}

get listingName() {
Expand Down Expand Up @@ -56,16 +51,15 @@ export class SnippetCollectionListing {

get listingSublinks() {
if (['blog', 'language', 'tag'].includes(this.snippetCollection.type)) {
const order = this._options.order;
return [
{
name: literals.tag('all'),
url: `${this.snippetCollection.rootUrl}/${order}/1`,
url: `${this.snippetCollection.rootUrl}/p/1`,
selected: this.snippetCollection.type === 'language',
},
...this.snippetCollection.tags.map(tag => ({
name: literals.tag(tag),
url: `${this.snippetCollection.rootUrl}/t/${tag}/${order}/1`,
url: `${this.snippetCollection.rootUrl}/t/${tag}/p/1`,
selected:
this.snippetCollection.type === 'tag'
? tag === this.snippetCollection.tag
Expand All @@ -92,11 +86,8 @@ export class SnippetCollectionListing {

/**
* Creates a plain object for the given snippet collection listing.
* @param {object} options - Options object, containing the following:
* - `order` - Order segment of the page slug. (default: `'p'`)
*/
toObject = ({ order = this._options.order } = this._options) => {
this._options.order = order;
toObject = () => {
return SnippetCollectionListing.serializableAttributes.reduce(
(obj, attr) => {
const val = this[attr];
Expand Down
14 changes: 12 additions & 2 deletions src/blocks/adapters/snippetContext/index.js
Expand Up @@ -78,7 +78,7 @@ export class SnippetContext {
}

get expertise() {
return Tag.format(this.snippet.expertise);
return this.snippet.expertise;
}

get language() {
Expand All @@ -103,8 +103,17 @@ export class SnippetContext {
return this.snippet.html;
}

get actionType() {
if (this.snippet.config.isBlog) return undefined;
return this.snippet.config.isCSS
? 'cssCodepen'
: this.snippet.config.isReact
? 'codepen'
: 'copy';
}

get code() {
return this.snippet.code;
return this.snippet.config.isCSS ? this.snippet.code : undefined;
}

get vscodeUrl() {
Expand All @@ -124,6 +133,7 @@ export class SnippetContext {
'icon',
'tags',
'html',
'actionType',
'code',
'authors',
'type',
Expand Down

0 comments on commit 7b0a57a

Please sign in to comment.