Skip to content

Commit

Permalink
remove netlify-specifc code/files
Browse files Browse the repository at this point in the history
  • Loading branch information
JKarlavige committed Sep 28, 2023
1 parent eb861dd commit 77e5208
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 945 deletions.
2 changes: 0 additions & 2 deletions netlify.toml

This file was deleted.

3 changes: 0 additions & 3 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ var siteSettings = {
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
trailingSlash: false,
customFields: {
isVercel: process.env.REACT_APP_VERCEL
},
themeConfig: {
docs:{
sidebar: {
Expand Down
8 changes: 1 addition & 7 deletions website/functions/image-cache-wrapper.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
// This function is used to break the cache on images
// preventing stale or broken images from being served

import useDocusaurusContext from '@docusaurus/useDocusaurusContext';

const CACHE_VERSION = '2'

export default function imageCacheWrapper(src) {
const { siteConfig: {customFields} } = useDocusaurusContext();

const cacheParam = customFields?.isVercel === '1'
? `?v=${CACHE_VERSION}`
: ``
const cacheParam = `?v=${CACHE_VERSION}`

return (
src + cacheParam
Expand Down
7 changes: 1 addition & 6 deletions website/src/components/discourse/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState, useEffect } from 'react'
import axios from 'axios'
import feedStyles from './styles.module.css';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';

// Bare component with no default props set
export const DiscourseFeed = ({
Expand All @@ -25,8 +24,6 @@ export const DiscourseFeed = ({
styles = {}
}) => {

const { siteConfig: {customFields} } = useDocusaurusContext();

const [topics, setTopics] = useState([])
const [loading, setLoading] = useState(true)
const [isError, setIsError] = useState(false)
Expand All @@ -42,9 +39,7 @@ export const DiscourseFeed = ({
setIsError(false)

// Build function endpoint
const endpoint = customFields?.isVercel === '1'
? `/api/get-discourse-topics`
: `/.netlify/functions/get-discourse-topics`
const endpoint = `/api/get-discourse-topics`

// If 'after' prop not passed in, set relative after date
let afterDate = after
Expand Down
7 changes: 1 addition & 6 deletions website/src/components/discourseBlogComments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ import React, { useState, useEffect } from 'react'
import styles from './styles.module.css'
import axios from 'axios'
import sanitizeHtml from 'sanitize-html';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';

export const DiscourseBlogComments = ({title,slug}) => {

const { siteConfig: {customFields} } = useDocusaurusContext();

const DISCOURSE_TOPIC_ENDPOINT = `https://discourse.getdbt.com/t/`
const commentsToLoad = 6

Expand All @@ -31,9 +28,7 @@ export const DiscourseBlogComments = ({title,slug}) => {
const fetchData = async () => {
try {

const endpoint = customFields?.isVercel === '1'
? `/api/get-discourse-comments?title=${title}&slug=${slug}`
: `/.netlify/functions/get-discourse-comments?title=${title}&slug=${slug}`
const endpoint = `/api/get-discourse-comments?title=${title}&slug=${slug}`

const { data } = await axios.get(endpoint)

Expand Down
5 changes: 0 additions & 5 deletions website/static/_headers

This file was deleted.

916 changes: 0 additions & 916 deletions website/static/_redirects

This file was deleted.

0 comments on commit 77e5208

Please sign in to comment.