Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Ima Computer
Oct 28, 2007

Stop all the downloading!

Help computer.
I moved all my domains to Porkbun a while back because they had reasonably competitive pricing and a cute pig mascot. Would recommend.

Adbot
ADBOT LOVES YOU

ModeSix
Mar 14, 2009

GigaFuzz posted:

What are the go-to domain registrars these days? I occasionally help clients at work set up some basic starter websites and I've been using Gandi for a while, but I think the value has fallen off with the price rises and dropping free email.

I seem to remember namecheap being decent. Any other goon favourites?

Cloudflare is great, your domain automatically gets hooked up to their system, and their prices are quite good. $9 or so per year for .com and similar prices for .net etc. No extra fee for registrant privacy information like some places like to charge for.

GigaFuzz
Aug 10, 2009

Cheers all for the recommendations. I'd been meaning to check out Cloudflare and it slipped my mind.

Golden Bee
Dec 24, 2009

I came here to chew bubblegum and quote 'They Live', and I'm... at an impasse.
I used to use redpen.io to annotate up drafts, but it’s defunct. What do ya'll use? I’m looking for something where I can easily import a webpage visually and have other people see my spot-notes.

I tried the OP but it's from 2013.

Harriet Carker
Jun 2, 2009

My friend operates a small business and wants to hire someone to do SEO for her website. I’m a frontend developer but I don’t know the first thing about SEO.

Super rough ballpark - what’s involved, how long would it take, and how much would a contractor charge? Is it a one-time thing or does it need constant work?

It’s a beauty and health related business with a brick and mortar store if it matters.

The Dave
Sep 9, 2003

Good SEO involves content strategy beyond just making sure the semantic markup is right. You need to know what keywords to leverage for that market and vertical, what types of pages will help
boost in google, what other services and platforms to leverage beyond just the site, and then you need to have a good reporting strategy to prove what you’re doing is a worthwhile investment.

To do it good it is not something you would simply tack on to your skill set as an engineer because it feels related.

Golden Bee
Dec 24, 2009

I came here to chew bubblegum and quote 'They Live', and I'm... at an impasse.
Obviously set up a Google listing for the business and physical location, but that’s a half hour job. Ranking in your niche means consistently putting out content people want (or continually putting out enough AI content to confuse google).

If they want, it’s easy enough to play around on moz.com with keyboard ranking tools, seeing what everyone else is advertising and searching for. I did that for a client today, and what I discovered is the people who would hire his services just don’t search Google for it often, so we need to find another way to advertise.

I have some extra capacity, so feel free to PM. Her space might be completely different.

Harriet Carker
Jun 2, 2009

I’ll send a DM!

To be clear, I’m not thinking of doing this myself. Just trying to make sure my friend doesn’t get ripped off or taken advantage of.

Boba Pearl
Dec 27, 2019

by Athanatos
She's going to get ripped off and taken advantage of. SEO firms suck rear end, and all the places that are good at it have dedicated people, or a dedicated guy. She's better off just posting about her business on reddit so that she gets customers from people googling "business niche reddit"

kedo
Nov 27, 2007

She wants to hire a marketing firm that includes SEO in their service. There are legitimate SEO firms out there, but they're mixed in with a huge number of snake oil salesmen.

Harriet Carker
Jun 2, 2009

kedo posted:

She wants to hire a marketing firm that includes SEO in their service. There are legitimate SEO firms out there, but they're mixed in with a huge number of snake oil salesmen.

So how do I help her know the difference? She’s already been fleeced once, which is why I’m asking (maybe there’s a better thread for this?)

Golden Bee
Dec 24, 2009

I came here to chew bubblegum and quote 'They Live', and I'm... at an impasse.

Harriet Carker posted:

So how do I help her know the difference? She’s already been fleeced once, which is why I’m asking (maybe there’s a better thread for this?)

Check out their sites, talk to the people, and ask for references.

Honestly, before you increase marketing, you should know how customers are discovering you, and focus on that, even if it’s boring. In-store promotion, local events, cobranding with businesses, all of these can have a much better impact and quicker than low amounts of online spending. Whoever she talks to should be asking a lot of questions.

His Divine Shadow
Aug 7, 2000

I'm not a fascist. I'm a priest. Fascists dress up in black and tell people what to do.

kedo posted:

She wants to hire a marketing firm that includes SEO in their service. There are legitimate SEO firms out there, but they're mixed in with a huge number of snake oil salesmen.

My boss has kept hiring those and it's basically always been the same bullshit. He still thinks there's some magic phrasing that will make google love us.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
tired: spend $500 a month on search ads
wired: spend $5000 a month on snake oil seo that drives less traffic than the search ads would

Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!
I have a web app that communicates with a web service frequently. Now I want a channel from server to client to push occasional session and user rights updates. And maybe notifications when other users are messing with the same data sets.

What are the pros and cons for either WebSockets and HTTP/2 SSEs?

The issue I see with HTTP/2 is that IT is dragging their balls all day every day. So if the TLS certificate expires and they lost my eventual ticket requesting a new one, HTTP/2 SSEs would break because no browser supports unencrypted HTTP/2 to fall back on.

The communication between the web app and web service is sufficiently abstracted on each end. Is indifferent as to whether it’s REST or something custom on WebSockets (I’d figure, if a socket is open, funnel everything over it).

MrMoo
Sep 14, 2000

Try and go SSE because it is more friendly to users behind corporate firewalls, has browser driven reconnection, and can technically scale horizontally a bit better. However WebSockets are pretty drat nice, just slightly weird implementations server side.

NodeJS WebSockets are annoyingly not the same as browser WebSockets, Python does it’s own thing sync or async, and C++ land has a plethora of bad options.

I’d recommend never using Socket.IO, it doesn’t don’t really provide any value but certainly has a cost to use.

spiritual bypass
Feb 19, 2008

Grimey Drawer

Combat Pretzel posted:

I have a web app that communicates with a web service frequently. Now I want a channel from server to client to push occasional session and user rights updates. And maybe notifications when other users are messing with the same data sets.

What are the pros and cons for either WebSockets and HTTP/2 SSEs?

The issue I see with HTTP/2 is that IT is dragging their balls all day every day. So if the TLS certificate expires and they lost my eventual ticket requesting a new one, HTTP/2 SSEs would break because no browser supports unencrypted HTTP/2 to fall back on.

The communication between the web app and web service is sufficiently abstracted on each end. Is indifferent as to whether it’s REST or something custom on WebSockets (I’d figure, if a socket is open, funnel everything over it).

If the cert fails, your users probably won't look at the site anyway

Gin_Rummy
Aug 4, 2007
Does anyone know of either a guide or a repo giving a solid example on linking a React front end to a Postgres database using Apollo?

The Apollo docs are decent at explaining how to setup Apollo Client and Apollo Server individually, but there isn’t really a lot of information I can find on how they relate to each other and/or the back end.

Last Chance
Dec 31, 2004

May not be a popular answer, but that’s the sort of thing I ask ChatGPT to give me the broad strokes for. Seems to work well in lieu of library documentation that can be too abstract or broad.

prom candy
Dec 16, 2005

Only I may dance

Gin_Rummy posted:

Does anyone know of either a guide or a repo giving a solid example on linking a React front end to a Postgres database using Apollo?

The Apollo docs are decent at explaining how to setup Apollo Client and Apollo Server individually, but there isn’t really a lot of information I can find on how they relate to each other and/or the back end.

If you're not too far in on Apollo I'd really suggest using something else. I'm running it on one of my longer running React apps and it really hasn't stood the test of time. I would love to tear it out. React Query is your best bet for a new SPA in 2023.

Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!

spiritual bypass posted:

If the cert fails, your users probably won't look at the site anyway
Probably. There's a small chance I'll wrap the front-end in Electron though.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Gin_Rummy posted:

Does anyone know of either a guide or a repo giving a solid example on linking a React front end to a Postgres database using Apollo?

The Apollo docs are decent at explaining how to setup Apollo Client and Apollo Server individually, but there isn’t really a lot of information I can find on how they relate to each other and/or the back end.

I mean, there's not much more to it than what you said. Is there something specific that is giving you troubles? You set up the server, have it's resolvers talk to the DB as needed, then your client is configured to point at that server, and makes requests via useQuery.

There's nothing magic about the client / server connection. Apollo client just makes POST requests to the server like you would with Fetch, just in a hook.

Gin_Rummy
Aug 4, 2007

Lumpy posted:

I mean, there's not much more to it than what you said. Is there something specific that is giving you troubles? You set up the server, have it's resolvers talk to the DB as needed, then your client is configured to point at that server, and makes requests via useQuery.

There's nothing magic about the client / server connection. Apollo client just makes POST requests to the server like you would with Fetch, just in a hook.

It's the "you set up the server" part that just isn't working out for me. I follow Apollo's docs to a tee and end up with type errors on the server object (no overload matches this call) I am pushing in the "startStandaloneServer" call. Literally identical up to step 6 of their docs (https://www.apollographql.com/docs/apollo-server/getting-started) and its broken.

I think there are some inconsistencies in their docs since they're deprecating Apollo Server 3 and moving to Apollo Server 4?

Really wanted to put together something with Apollo (as opposed to using something like React Query as someone suggested) to better understand the frameworks I've been using at my job, but I'm starting to get real tired of trying to brute force this.

Polio Vax Scene
Apr 5, 2009



Trying to get npm build to get my output files juuust right...

I'm using the rewired package to change the output filenames.

I have config-override.js set like this currently:
code:
    config.output.filename = "./js/match.js";
    config.output.chunkFilename = "./js/match.chunk.js"
    config.plugins[5].options.filename = "./css/match.css";
    config.plugins[5].options.moduleFilename = () => "./css/match.css";
And the built HTML file gets the files referenced like so:
code:
	script defer="defer" src="/./js/match.js"/
	link href="/./css/match.css" rel="stylesheet"/
(imagine the above has the appropriate brackets - if I try to post it with them included, the forums won't let me)

I want the urls in the output HTML file to have the beginning "/" removed, so they start with "./". I am doing this because the html, js, and css are being published into a different system and is not resolving the js and css files when their url starts with /.
If I try removing the . from the filename configs I cant build.

code:
Failed to compile.

Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration.output.chunkFilename: A relative path is expected. However, the provided value "/js/match.chunk.js" is an absolute path!
 - configuration.output.filename: A relative path is expected. However, the provided value "/js/match.js" is an absolute path!
   Please use output.path to specify absolute path and output.filename for the file name.
I've tried setting the config.output.path config but having no such luck.

For context I just started trying to learn how to use React and npm yesterday so I have no idea wtf I'm doing


Update: below change did it, thanks!

Polio Vax Scene fucked around with this message at 18:46 on Aug 23, 2023

Ima Computer
Oct 28, 2007

Stop all the downloading!

Help computer.

Polio Vax Scene posted:

Trying to get npm build to get my output files juuust right...

I'm using the rewired package to change the output filenames.

Webpack is painful to configure, even for those of us who've been doing it for years. And it's especially awkward to try to patch an existing config from create-react-app.

I think there's a solution for your problem that doesn't involve fiddling with webpack though.

According to this docs page, you can add this line to your package.json to build for relative paths:
JSON code:
  "homepage": ".",

Polio Vax Scene posted:

For context I just started trying to learn how to use React and npm yesterday so I have no idea wtf I'm doing

I would recommend considering checking out some other options besides create-react-app - it's no longer maintained, supported, or recommended anymore.

The docs currently recommend starting out with a framework like Next.js, but if a framework is overkill, Vite's react template is a strong replacement for create-react-app, and also much easier to configure and customize.

White Light
Dec 19, 2012

I'm thinking I'd like to find a different web designer job, you know? Been working for my county for four+ years without a single pay increase, and I live in a state that really tends to skirt out on employee benefits that most other states enjoy (I live in Texas).

It's honestly been getting to me a lot lately but I feel like I'm job-locked with no real path of escaping to greener pastures. Does anyone have some good advice or leads on where I might like to start looking first? It'd be real swell to live in an area not forever destined to drown in an autocratic chamber area.

America Inc.
Nov 22, 2013

I plan to live forever, of course, but barring that I'd settle for a couple thousand years. Even 500 would be pretty nice.

White Light posted:

It's honestly been getting to me a lot lately but I feel like I'm job-locked with no real path of escaping to greener pastures. Does anyone have some good advice or leads on where I might like to start looking first? It'd be real swell to live in an area not forever destined to drown in an autocratic chamber area.

1. Try to attend design or tech meetups in your area and get to know people. Even if you're a goon, you must have some people skills to have got this far.
2. Do you have LinkedIn? Reach out to people at places you want to work and ask for informational interviews. Not referrals, which are usually worthless if the person hasn't worked with you before, but interviews where you ask what they do and what the company is like and get their opinion. Ask what skills you need to get hired.
3. Spend some time everyday sending out job applications. It's a numbers game where you apply to a lot of companies and you learn. If people aren't getting back to you, that means you've got to change something up. Get to interviews, gently caress up and learn some more.

Everybody's heard of that story of that guy who had a magic hookup through their friend to a cool company but don't hinge your job search on it. Hope for the best, plan for the worst.

I'm a web developer so I'm not sure of good design job boards or learning resources.

The Dave
Sep 9, 2003

What kind of design do you gravitate towards? I think first is identifying that so you can then find a more targeted search. There's a spectrum of visual designer to hardcore UXer that doesn't work past wireframes and everything in between like design systems, prototyping, motion, etc. "Web designer" doesn't mean anything these days and experience with native apps /mobile web may be important.

I see a healthy amount of design jobs posted on LinkedIn and Twitter. I'm also a product design / design system Creative Director so if you want to pass a portfolio by I'm happy to take a look.

frogbs
May 5, 2004
Well well well
So i've had a site setup using Hugo and Netlify CMS for a while, and I wanted to update it to a more modern stack, so i've been toying with Astro a bit. In my Hugo theme, I can take frontmatter and apply some terrible logic using the frontmatter as a variable, then output that to the page. It seems like that's not that easy in Astro. Am I misunderstanding it's capabilities?

code:
{{ $internalwidth := float .Params.intwidth }}
I could then use {{ $internalwidth }} in the template directly. Is that possible?

The full logic is even stupider, i'm sure there's a better way to do this, even in Hugo. I'm just trying to get the largest ($max) and smallest ($min) values from internal width, height and depth and output each as a variable:
code:
                {{ $internalwidth := float .Params.intwidth }}
                {{ $internalheight := float .Params.intheight }}
                {{ $internaldepth := float .Params.intdepth }}
                {{ $list := slice $internalwidth $internalheight $internaldepth }}
                {{ $list := sort $list }}
                {{ $min := index $list 0 }}
                {{ $length := len $list }}
                {{ $last_index := sub $length 1 }}
                {{ $max := index $list $last_index }}
I know i'm old, but it seems like a lot of tooling today is complication for complication's sake, why do I have to define the frontmatter in like 3 different places, why does everyone want to use typescript for a blog stack, is that really necessary? Anyway now i'm just complaining, it's all pretty amazing.

frogbs fucked around with this message at 18:48 on Sep 3, 2023

prom candy
Dec 16, 2005

Only I may dance
I'm pretty sure what you want to do is doable with Astro but I don't know Hugo so I'm also not super clear on what you're trying to accomplish.

frogbs
May 5, 2004
Well well well

prom candy posted:

I'm pretty sure what you want to do is doable with Astro but I don't know Hugo so I'm also not super clear on what you're trying to accomplish.

I've got three values that exist in the front matter for a post. I want the post template to take those values, figure out which one is the largest or smallest and assign new variables to each. I then want to use those variables in the post template.

prom candy
Dec 16, 2005

Only I may dance

frogbs posted:

I've got three values that exist in the front matter for a post. I want the post template to take those values, figure out which one is the largest or smallest and assign new variables to each. I then want to use those variables in the post template.

Something like this?

src/content/config.ts
code:
import { defineCollection, z } from "astro:content";

const posts = defineCollection({
  type: "content",
  schema: z.object({
    number1: z.number(),
    number2: z.number(),
    number3: z.number(),
  }),
});

export const collections = { posts };
src/content/posts/my-post.md
code:
---
number1: 100
number2: 200
number3: 300
slug: my-post
---

Hello this is a post
src/pages/[slug].astro
code:
---
import { getEntry } from "astro:content";

const { slug } = Astro.params;
const post = await getEntry("posts", slug);

if (!post) {
  return new Response(null, { status: 404, statusText: 'Not found'});
}

const { number1, number2, number3 } = post.data;
const highest = Math.max(number1, post.data.number2, post.data.number3);
const lowest = Math.min(number1, number2, number3);
---

<h1>Hello: {slug}</h1>

<p>Highest: {highest}</p>

<p>Lowest: {lowest}</p>
I still don't get exactly what you're trying to do but this is how you get details from the frontmatter of a post and use it in the template. If you're running in SSG mode you need to also define getStaticPaths so it knows which post pages to generate but otherwise it should work the same.

prom candy fucked around with this message at 03:57 on Sep 4, 2023

frogbs
May 5, 2004
Well well well

prom candy posted:

Something like this?

src/content/config.ts
code:
import { defineCollection, z } from "astro:content";

const posts = defineCollection({
  type: "content",
  schema: z.object({
    number1: z.number(),
    number2: z.number(),
    number3: z.number(),
  }),
});

export const collections = { posts };
src/content/posts/my-post.md
code:
---
number1: 100
number2: 200
number3: 300
slug: my-post
---

Hello this is a post
src/pages/[slug].astro
code:
---
import { getEntry } from "astro:content";

const { slug } = Astro.params;
const post = await getEntry("posts", slug);

if (!post) {
  return new Response(null, { status: 404, statusText: 'Not found'});
}

const { number1, number2, number3 } = post.data;
const highest = Math.max(number1, post.data.number2, post.data.number3);
const lowest = Math.min(number1, number2, number3);
---

<h1>Hello: {slug}</h1>

<p>Highest: {highest}</p>

<p>Lowest: {lowest}</p>
I still don't get exactly what you're trying to do but this is how you get details from the frontmatter of a post and use it in the template. If you're running in SSG mode you need to also define getStaticPaths so it knows which post pages to generate but otherwise it should work the same.

Oh wow, thank you so much. This is incredibly helpful. I'm going to try this out.

prom candy
Dec 16, 2005

Only I may dance

frogbs posted:

Oh wow, thank you, i'm going to try this out.

No problem i actually havent had a chance to screw around with Astro too much but I was like 95% certain what you were trying to do is doable so it gave me an excuse to spin up an app.

frogbs
May 5, 2004
Well well well

prom candy posted:

No problem i actually havent had a chance to screw around with Astro too much but I was like 95% certain what you were trying to do is doable so it gave me an excuse to spin up an app.

Just wanted to thank you again for this, I've gotten much further along in my project after looking at what you provided and reading more of the documentation.

The thing i'm wrestling with now is having a field in my schema and .md files that is occasionally empty. If I try to render some HTML based on that value being empty or not my Astro build fails. I feel like this is a pretty common thing to do in an SSG (I did it in Hugo no problem), but it seems like Astro is more strict.

The field is called 'address'. In my frontmatter if it's empty it just looks like 'address: '. I'm using a JSX expression to render it only if it has a value:
code:
{entry.data.address && <p>{entry.data.address}</p>}
But that triggers an error on build if 'address' has no value. If I remove it from the .md file the HTML isn't rendered.
code:
frontmatter does not match collection schema.
address: Expected type "string", received "null"
I thought it could be my schema needing to allow 'null' as a value, but an not finding a lot of documentation on how to do that with Zod.

Edit: It looks like this may be a bug? https://github.com/withastro/astro/issues/6469

prom candy
Dec 16, 2005

Only I may dance

frogbs posted:

Just wanted to thank you again for this, I've gotten much further along in my project after looking at what you provided and reading more of the documentation.

The thing i'm wrestling with now is having a field in my schema and .md files that is occasionally empty. If I try to render some HTML based on that value being empty or not my Astro build fails. I feel like this is a pretty common thing to do in an SSG (I did it in Hugo no problem), but it seems like Astro is more strict.

The field is called 'address'. In my frontmatter if it's empty it just looks like 'address: '. I'm using a JSX expression to render it only if it has a value:
code:
{entry.data.address && <p>{entry.data.address}</p>}
But that triggers an error on build if 'address' has no value. If I remove it from the .md file the HTML isn't rendered.
code:
frontmatter does not match collection schema.
address: Expected type "string", received "null"
I thought it could be my schema needing to allow 'null' as a value, but an not finding a lot of documentation on how to do that with Zod.

Edit: It looks like this may be a bug? https://github.com/withastro/astro/issues/6469

No problem! Astro is sweet and I don't actually get a lot of opportunities to use it. I had fun digging into your problem last weekend.

In Zod I think you would express this as z.string().nullable(), or you could use .optional() and then not supply the address in the frontmatter at all if you don't have it.

prom candy
Dec 16, 2005

Only I may dance
While we're talking about cool poo poo, Bun 1.0 is out: https://bun.sh/

Looks like it's super loving fast and has tons of DX improvements over Node. I was playing around with it a bit last night and it installs packages insanely fast.

frogbs
May 5, 2004
Well well well

prom candy posted:

No problem! Astro is sweet and I don't actually get a lot of opportunities to use it. I had fun digging into your problem last weekend.

In Zod I think you would express this as z.string().nullable(), or you could use .optional() and then not supply the address in the frontmatter at all if you don't have it.

You're right again! .nullable() was the solution. I swear I tried it the other day and it didn't work, but I gave it another shot today and it worked fine. Must have been a syntax problem or something. Thanks again!

MREBoy
Mar 14, 2005

MREs - They're whats for breakfast, lunch AND dinner !
Soliciting help with CSS ok in here or is there another suggested thread ? has to do with width/placing of something on a page

Adbot
ADBOT LOVES YOU

Last Chance
Dec 31, 2004

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply